[英]When should I use AQL?
In the context of ArangoDB, there are different database shells to query data: 在ArangoDB的上下文中,有不同的数据库外壳可以查询数据:
arangosh: The JavaScript based console arangosh:基于JavaScript的控制台
AQL: Arangodb Query Language, see http://www.arangodb.org/2012/06/20/querying-a-nosql-database-the-elegant-way AQL:Arangodb查询语言,请参见http://www.arangodb.org/2012/06/20/querying-a-nosql-database-the-elegant-way
MRuby: Embedded Ruby MRuby:嵌入式Ruby
Although I understand the use of JavaScript and MRuby, I am not sure why I would learn, and where I would use AQL. 尽管我了解JavaScript和MRuby的用法,但是我不确定为什么要学习以及在哪里使用AQL。 Is there any information on this?
是否有任何信息? Is the idea to POST AQL directly to the database server?
是将AQL直接发布到数据库服务器的想法吗?
AQL is ArangoDB's query language. AQL是ArangoDB的查询语言。 It has a lot of ways to query, filter, sort, limit and modify the result that will be returned.
它有很多方法可以查询,过滤,排序,限制和修改将要返回的结果。 It should be noted that AQL only reads data.
应当注意,AQL仅读取数据。
(Update: This answer was targeting an older version of ArangoDB. Since version 2.2, the features have been expanded and data modification on the database is also possible with AQL. For more information on that, visit the documentation link at the end of the answer.) (更新:此答案针对的是较旧版本的ArangoDB。自2.2版以来,此功能已得到扩展,并且使用AQL还可对数据库进行数据修改。有关此的更多信息,请访问答案末尾的文档链接)
You cannot store data to the database with AQL. 您不能使用AQL将数据存储到数据库。
In contrast to AQL, the Javascript or MRuby can read and store data to the database. 与AQL相比,Javascript或MRuby可以读取数据并将其存储到数据库。 However their querying capabilities are very basic and limited, compared to the possibilities that open up with AQL.
但是,与AQL所带来的可能性相比,它们的查询功能非常基础且有限。
It is possible though to send AQL queries from javascript. 虽然可以从javascript发送AQL查询。 Within the arangosh Javascript shell you would issue an AQL query like this:
在arangosh Javascript shell中,您将发出如下AQL查询:
arangosh> db._query('FOR user IN example FILTER user.age > 30 RETURN user').toArray()
[
{
_id : "4538791/6308263",
_rev : "6308263",
age : 31,
name : "Musterfrau"
}
]
You can find more info on AQL here: http://www.arangodb.org/manuals/current/Aql.html 您可以在此处找到有关AQL的更多信息: http : //www.arangodb.org/manuals/current/Aql.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.