ArangoDB 创建边缘集合

ArangoDB create edge collection

我尝试通过 ArangoDB-NET 驱动程序 (https://github.com/yojimbo87/ArangoDB-NET) 在 C# 中创建边缘集合,但此代码不起作用。我的代码:

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

dbClient 是一个数据库对象。 集合已创建,但文档类型不是边缘。我该怎么办?

我不熟悉那个驱动程序,你的问题似乎与实现有关,与数据库功能无关。但是,我最好的猜测是省略 KeyGeneratorTypeWaitForSync 选项:

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

如果这不起作用,那么您可能需要查看 docs,或者添加一些其他选项,例如 KeyIncrement。一般来说,我会接受默认值,只修改(或提供显式参数)您需要更改的内容(即"don't work" ).