简体   繁体   中英

ArangoDB create edge collection

I tried create collection of edges in c# via ArangoDB-NET driver ( https://github.com/yojimbo87/ArangoDB-NET ) and this code not working.. My code:

 var response = dbClient.Collection.Type(ACollectionType.Edge).KeyGeneratorType(AKeyGeneratorType.Autoincrement).WaitForSync(true).Create(
                "EdgesCollection");

dbClient is ADatabase object. Collection is created but document type is not edge. How can I do?

I'm not familiar with that driver, and your question seems to be related to implementation, not DB functionality. However, my best guess would be to omit the KeyGeneratorType and WaitForSync options:

var cType = ACollectionType.Edge;
var cName = "EdgesCollection";
var response = dbClient.Collection.Type(cType).Create(cName);

If this fails to work, then you may need to review the docs , maybe add some other options like KeyIncrement . Generally, I would accept the defaults and only modify (or provide explicit parameters for) things that you NEED to change (ie "don't work").

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