Insert Many

Inserts many documents

Use bulk insert when you want to insert many records into the database with one API call. This can be useful when you import data from any other sources.

var client = new CodeMashClient(apiKey, projectId);
var service = new CodeMashRepository<Person>(client);

var person1 = new Person { Name = "John" };
var person2 = new Person { Name = "Peter" };

var entities = new List<Person> { person1, person2 };

await service.InsertManyAsync(entities, new DatabaseInsertManyOptions());

Check the information about entities on how your class objects are serialized.

Last updated