2

Our production environment doesn't provide a shell but only javascript engine and REST interface. Our arangodb server will be installed at a remote location. Since all of our users are comfortable with javascript implementation we are looking for a solution if we could provide them an interface where they write the queries for arangodb in javascript (the way we do in arangodbsh) and we can execute them remotely and get the result. Is it somehow possible ?

I am new to arangodb and so far I have found that there is only REST interface available to interact remotely.

arangosh is not available and can not be used.

1 Answer 1

4

You can use arangosh to connect to the remote server as it uses the REST interface to work. All information on connecting to your server is available via arangosh --help. The default behaviour of arangosh is to connect to a local ArangoDB instance, but it can connect to remote ones as well.

You probably want to do something like, where 1.2.3.4 is the IP of your remote server:

arangosh --server.endpoint tcp://1.2.3.4:8529

If you want to execute arbitrary JavaScript code in ArangoDB from an application, you can use the endpoint /_admin/execute described here that takes JavaScript code as its body that will be executed in ArangoDB. Be aware that this is a potential security risk

Sign up to request clarification or add additional context in comments.

6 Comments

Shell is not available to the environment I want to run javascript from :( . The environment is a cloud where javascript engine and REST is available but no shell.
@DeepakAgarwal You can run arangosh on your local machine. It doesn't need to be available on the server :)
:) Yea. Actually let me explain more. My application resides on a cloud platform (ServiceNow). I can not install arango there. Arangodb is installed at separate machine. Users of my application can write only javascript and REST calls (which are residing at servicenow only). So I need a way where the written javascripts can be run at Arangodb from my servicenow application. So, scripts are essentially remote. One way is to use AQL but our scripts would be complex. arangosh can not be available at servicenow app at all.
Ok, understood. Adjusted the answer above! Hope that helps? Please be aware of the security implications of this step.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.