public BsonDocument(BsonValue value) : base(value.AsObject.RawValue) { if (!this.HasKey("_id")) throw new ArgumentException("BsonDocument must have an _id key"); this.Id = this["_id"].RawValue; this.RemoveKey("_id"); }
public BsonValue(BsonValue value) { this.Type = value.Type; this.RawValue = value.RawValue; }
/// <summary> /// Add fields in fluent api /// </summary> public BsonObject Add(string key, object value) { this[key] = new BsonValue(value); return this; }
/// <summary> /// Add fields in fluent api /// </summary> public BsonObject Add(string key, object value) { this[key] = new BsonValue(value); return(this); }