public async Task CreateAsync(ArangoHandle database, string collection, ArangoCollectionType type, CancellationToken cancellationToken = default) { await SendAsync <ArangoVoid>(HttpMethod.Post, ApiPath(database, "collection"), new ArangoCollection { Name = collection, Type = type }, cancellationToken : cancellationToken); }
public static void CreateTestCollection(string collectionName, ArangoCollectionType collectionType = ArangoCollectionType.Document) { var db = GetTestDatabase(); if (db.Collection.Get(collectionName) != null) { // delet collection if it exists db.Collection.Delete(collectionName); } // create new test collection var collection = new ArangoCollection(); collection.Name = collectionName; collection.Type = collectionType; db.Collection.Create(collection); }
public async Task CreateCollectionAsync(ArangoHandle database, string collection, ArangoCollectionType type, CancellationToken cancellationToken = default) { await SendAsync <JObject>(HttpMethod.Post, $"{Server}/_db/{DbName(database)}/_api/collection", JsonConvert.SerializeObject(new ArangoCollection { Name = collection, Type = type }, JsonSerializerSettings), cancellationToken : cancellationToken); }