How to write this update query for updating a mongo record in c#.
db.collection.update({ "S_Id" : 110 },{ "Name" : "Name1","Batch" : "43","Date":"9/2/2011", "Status" : 0 });
I'am trying like this
IMongoUpdate update = new UpdateDocument();
if (Named != null) { update = Update.Set("Name", "Name1"); }
if (Date != null) { update = Update.Set("Date", "18/02/2013"); }
if (Batch != null) { update = Update.Set("Batch",43); }
coll.Update(query, update);
was I'am doing correct or in what way i have to do it, please make me the correct way to proceed.