与arangodb的远程javascript交互 [英] Remote javascript interaction with arangodb

查看:83
本文介绍了与arangodb的远程javascript交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的生产环境不提供外壳程序,而仅提供javascript引擎和REST接口.我们的arangodb服务器将安装在远程位置.由于我们所有的用户都对javascript的实现感到满意,因此我们正在寻找一种解决方案,如果我们可以为他们提供一个接口,让他们在javascript中编写对arangodb的查询(我们在arangodbsh中的方式),然后我们就可以远程执行它们并获得结果. 有可能吗?

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 ?

我是arangodb的新手,到目前为止,我发现只有REST接口可用于远程交互.

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

arangosh 不可用,无法使用.

推荐答案

您可以使用arangosh连接到远程服务器,因为它使用REST接口工作.有关连接到服务器的所有信息,可通过arangosh --help获得. arangosh的默认行为是连接到本地ArangoDB实例,但它也可以连接到远程实例.

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.

您可能想要执行类似的操作,其中1.2.3.4是您的远程服务器的IP:

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

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

如果要从应用程序在ArangoDB中执行任意JavaScript代码,则可以使用

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

这篇关于与arangodb的远程javascript交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆