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

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

问题描述

我们的生产环境不提供shell,只提供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

如果您想从应用程序执行 ArangoDB 中的任意 JavaScript 代码,您可以使用端点 /_admin/execute 描述的 here 以 JavaScript 代码为主体,将在 ArangoDB 中执行.请注意,这是一个潜在的安全风险

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

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

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