public void ImportSchemaData(Models.Schema schema, IEnumerable<IDictionary<string, object>> data) { var dataCollection = schema.GetCollection(); var docs = data.Select(it => (new TextContent(it) { Repository = schema.Repository.Name }).ToBsonDocument()).ToArray(); if (docs.Length > 0) { dataCollection.InsertBatch(docs); } }
public IEnumerable<IDictionary<string, object>> ExportSchemaData(Models.Schema schema) { var collection = schema.GetCollection(); return collection.FindAll().Select(it => it.ToContent()); }