Details
-
Task
-
Resolution: Done
-
Major - P3
-
None
-
2.0
-
None
Description
Hi,
running that code :
await this.Collection.ReplaceOneAsync(x => x.Name == city.Name x.CountryCode == city.CountryCode, newObject, new UpdateOptions()
{ IsUpsert = true });
if the object doesn't exist it create the new one but with an empty id.
Here what is stored
/* 1 */
{ "_id" : ObjectId("000000000000000000000000"), "CreateAt" : [ NumberLong(635700317931446025), 0 ], "UpdateAt" : [ NumberLong(635700317931446025), 0 ], "Name" : "My value", "CountryCode" : "it", "Culture" : "en-US" }