-
Type: Task
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.2.4, 2.4
-
Component/s: Operations
-
Environment:Windows Server 2016, Asp.net,
public async Task SomeWork() { Debug.WriteLine("SomeWork for User : " + Context.User.Identity.Name); var userProfile = await UserProfileCollection.Find(u => u._id == Context.User.Identity.Name).FirstOrDefaultAsync(); userProfile.SuccessfullConnect = true; // currently false var up = await UserProfileCollection.FindOneAndReplaceAsync(u => u._id == userProfile._id, userProfile); Debug.WriteLine(ObjectDumper.Dump(userProfile)); Debug.WriteLine(ObjectDumper.Dump(up)); Debug.WriteLine("Saved SomeWork for User : " + Context.User.Identity.Name); }
Below is the debug output. My document is not getting replaced. Check SuccessfullConnect variable it is still false. I checked on server also document is not replaced. And sometime its working and sometime its not working.
SomeWork for User : +919933221101 {TestSignalR_Server.Models.UserProfile} _id: "+919933221101" ... SuccessfullConnect: True ... {TestSignalR_Server.Models.UserProfile} _id: "+919933221101" ... SuccessfullConnect: False ... Saved SomeWork for User : +919933221101