我尝试通过ArangoDB-NET驱动程序(https://github.com/yojimbo87/ArangoDB-NET)在c#中创建边集合,并且此代码不起作用。我的代码:
var response = dbClient.Collection.Type(ACollectionType.Edge).KeyGeneratorType(AKeyGeneratorType.Autoincrement).WaitForSync(true).Create(
"EdgesCollection");
dbClient是ADatabase对象。创建了集合,但是文档类型不是edge。我该怎么办?
我不熟悉该驱动程序,您的问题似乎与实现有关,与数据库功能无关。但是,我最好的猜测是忽略KeyGeneratorType
和WaitForSync
选项:
var cType = ACollectionType.Edge;
var cName = "EdgesCollection";
var response = dbClient.Collection.Type(cType).Create(cName);
如果此操作无效,则您可能需要查看docs,也许添加一些其他选项,例如KeyIncrement
。通常,我会接受默认值,并且只修改(或提供明确的参数)您NEED进行更改(即“不起作用”)的内容。