简体   繁体   English

ArangoDB HTTP / AQL创建索引

[英]ArangoDB HTTP/AQL CREATE INDEX

To ensure unique edges in my edge collection I can index _from and _to fields as mentioned in the documentation 为了确保边缘集合中的唯一边缘,我可以按照文档中所述索引_from_to字段

db.edges.ensureIndex({ type: "hash", fields: [ "_from", "_to" ], unique: true });

The above operation can only be performed from arangosh . 以上操作只能从arangosh执行。 However I am writing a setup function that is supposed to create all the required vertex and edge collection mostly through the HTTP API. 但是,我正在编写一个设置函数,该函数应该主要通过HTTP API创建所有必需的顶点和边缘集合。 I need to know how to perform the same action through AQL or HTTP Api. 我需要知道如何通过AQL或HTTP Api执行相同的操作。

AQL does not provide any means for data-definition language operations, such as creating/dropping databases, collections or indexes. AQL不提供任何用于数据定义语言操作的方法,例如创建/删除数据库,集合或索引。

The purpose of AQL is running data selection and data modification queries against an ArangoDB database. AQL的目的是针对ArangoDB数据库运行数据选择和数据修改查询。

Data-definition operations can be carried out via ArangoDB's HTTP API, the ArangoDB web interface or the Arango shell (arangosh). 可以通过ArangoDB的HTTP API,ArangoDB Web界面或Arango Shell(arangosh)来执行数据定义操作。 The latter two will use the regular HTTP API of ArangoDB too. 后两者也将使用ArangoDB的常规HTTP API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM