I'm using MongoDb C# driver in my application and I need to update a sub-item in my document. I found the way doing something like this:
var query = Query<User>.ElemMatch(_=>_.Item, qb=>qb.EQ(x => x.Valid,false));
var update = Update.Set("Item.$.Valid", true); <-- can I use lambda here?
var result = collection.Update(query, update);
Now I want to ask you: Can I use lambda syntax to remove the fixed string "Item.$.Valid" enabling compile-time check (like Update<Item>.Set(x=>x...)?
Inside driver source code I've found nothing about this!