I use mongoDB in my project,and I use Collection.Update method in my code,but it not work properly, it will fail at sometimes,the code is pasted below:
collections.Update(Query.EQ("_id", ObjectId.Parse(databaseid)),Update.Set("agent",ip))
If I tried to add code after this line maybe it will work at most of time:
Thread.Sleep(2000);
so where is the problem?