How to use Auto Increment field in Mongo C# Driver without using eval?
问题 I'm using auto increment fild as discussed here. I can execute this example in Mongo Console, but how can I implement such a thing using c# driver ? db.products.insert({ "_id":getNextSequenceValue("productid"), "product_name":"Apple iPhone", "category":"mobiles" }) Is it possible to specify a function in the write operation ? I could call this function using Eval, but as it is being deprecated, I would like to find a solution without using it. 回答1: As exemplified here: var client = new