public void Update(MealPlan plan) { var filter = Builders <BsonDocument> .Filter.Eq("ID", plan.ID); var option = new UpdateOptions(); option.IsUpsert = true; var result = _collection.ReplaceOne(filter, plan.ToBsonDocument(), option); }
public MealPlan Save(MealPlan plan) { plan.ID = MongoBase.AutoID("mealplan"); _collection.InsertOne(plan.ToBsonDocument()); return(plan); }