public object Save(IDictionary<string, object> obj, bool safe = false) { if (!obj.ContainsKey("_id")) { return Insert(obj, safe); } Update(new Doc { { "_id", obj["_id"] } }, obj, true, false, safe); return obj["_id"]; }