Remote javascript interaction with arangodb

别来无恙 提交于 2020-01-13 19:23:26

问题


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:


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



来源:https://stackoverflow.com/questions/26991902/remote-javascript-interaction-with-arangodb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!