简体   繁体   English

ArangoDB 创建边缘集合

[英]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:我尝试通过 ArangoDB-NET 驱动程序( https://github.com/yojimbo87/ArangoDB-NET )在 c# 中创建边缘集合,但此代码不起作用。我的代码:

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

dbClient is ADatabase object. dbClient 是 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:但是,我最好的猜测是省略KeyGeneratorTypeWaitForSync选项:

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 .如果这不起作用,那么您可能需要查看文档,也许添加一些其他选项,例如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").一般来说,我会接受默认值,只修改(或提供显式参数)您需要更改的内容(即“不工作”)。

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

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