Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eval JavaScript handle named xquery #30

Open
jmakeig opened this issue Apr 18, 2016 · 0 comments
Open

Eval JavaScript handle named xquery #30

jmakeig opened this issue Apr 18, 2016 · 0 comments
Assignees

Comments

@jmakeig
Copy link
Contributor

jmakeig commented Apr 18, 2016

Quick and dirty eval

eval) 
  JSIN=${2:-'xdmp:version();'}
  DB=${3:-'Documents'}
  curl http://localhost:8000/v1/eval --digest -u admin:admin -X POST -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: multipart/mixed' -d database="$DB" --data-urlencode javascript="$JSIN"
;;

Invoked as mlvm eval 'fn.collection();' my-custom-database, which returns an (ugly) HTTP multipart response.

Obviously the above doesn't account for:

  • Session-based authentication
  • XQuery
  • Piping eval’d code in from the commandline

…and probably lots of other things.

@jmakeig jmakeig self-assigned this Apr 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant