public void Add(Interaction entry) { BsonDocument document = SparkBsonHelper.ToBsonDocument(entry); Supercede(entry.Key); collection.Save(document); }
public void Add(Entry entry) { BsonDocument document = SparkBsonHelper.ToBsonDocument(entry); Supercede(entry.Key); collection.InsertOne(document); }
public async Task Add(Entry entry) { BsonDocument document = SparkBsonHelper.ToBsonDocument(entry); await Supercede(entry.Key).ConfigureAwait(false); await _collection.InsertOneAsync(document).ConfigureAwait(false); }
public static IEnumerable <Entry> ToEntries(this MongoCursor <BsonDocument> cursor) { foreach (BsonDocument document in cursor) { Entry entry = SparkBsonHelper.ToEntry(document); yield return(entry); } }
public static IEnumerable <Interaction> ToInteractions(this MongoCursor <BsonDocument> cursor) { foreach (BsonDocument document in cursor) { Interaction entry = SparkBsonHelper.ToInteraction(document); yield return(entry); } }
public void Replace(Interaction entry) { string versionid = entry.Resource.Meta.VersionId; IMongoQuery query = MonQ.Query.EQ(Field.VERSIONID, versionid); BsonDocument current = collection.FindOne(query); BsonDocument replacement = SparkBsonHelper.ToBsonDocument(entry); SparkBsonHelper.TransferMetadata(current, replacement); IMongoUpdate update = MonQ.Update.Replace(replacement); collection.Update(query, update); }