Details about the ArangoDB Shell

    The shell will print its own version number and if successfully connectedto a server the version number of the ArangoDB server.

    Use to get a list of command-line options:

    1. unix> ./arangosh --help
    2. STANDARD options:
    3. --audit-log <string> audit log file to save commands and results to
    4. --configuration <string> read configuration file
    5. --help help message
    6. --max-upload-size <uint64> maximum size of import chunks (in bytes) (default: 500000)
    7. --no-auto-complete disable auto completion
    8. --no-colors deactivate color support
    9. --pager <string> output pager (default: "less -X -R -F -L")
    10. --quiet no banner
    11. --temp.path <string> path for temporary files (default: "/tmp/arangodb")
    12. --use-pager use pager
    13. JAVASCRIPT options:
    14. --javascript.check <string> syntax check code JavaScript code from file
    15. --javascript.execute <string> execute JavaScript code from file
    16. --javascript.execute-string <string> execute JavaScript code from string
    17. --javascript.startup-directory <string> startup paths containing the JavaScript files
    18. --javascript.unit-tests <string> do not start as shell, run unit tests instead
    19. --jslint <string> do not start as shell, run jslint instead
    20. --log.level <string> log level (default: "info")
    21. CLIENT options:
    22. --server.connect-timeout <double> connect timeout in seconds (default: 3)
    23. --server.endpoint <string> endpoint to connect to, use 'none' to start without a server (default: "tcp://127.0.0.1:8529")
    24. --server.password <string> password to use when connecting (leave empty for prompt)
    25. --server.request-timeout <double> request timeout in seconds (default: 300)
    26. --server.username <string> username to use when connecting (default: "root")

    So while this code may produce similar results when executed in arangosh andarangod, the cpu usage and time required will be really different:

    Since the arangosh version will be doing around 100k HTTP requests, and thearangod version will directly write to the database.

    1. #!/usr/bin/arangosh --javascript.execute
    2. require("internal").print("hello world")
    3. db._query("FOR x IN test RETURN x").toArray()

    Note that the first line has to end with a blank in order to make it work.Mark it executable to the OS:

    and finaly try it out: