简体   繁体   中英

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

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

The above operation can only be performed from 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. I need to know how to perform the same action through AQL or HTTP Api.

AQL does not provide any means for data-definition language operations, such as creating/dropping databases, collections or indexes.

The purpose of AQL is running data selection and data modification queries against an ArangoDB database.

Data-definition operations can be carried out via ArangoDB's HTTP API, the ArangoDB web interface or the Arango shell (arangosh). The latter two will use the regular HTTP API of ArangoDB too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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