command:
{"findandmodify": "Sequence", "query": {"...."}, "update": { "$set":
{"$inc": {"Sequence":1}}}, "sort": {}, "new": true}
To increment "Sequence" is what I want to do, but generated command for
updating document is {"$set":{"$inc":{"Sequence":1}}}.
The codes which call FindAndModify() are as followings.
var col = Database.GetCollection<Sequence>();
var next = col.FindAndModify(new Document("$inc", new
Document("Sequence", 1)), selectorDocumentObject, true);
Am I misunderstanding how to use FindAndModify() or is it bug ?
FYI.
MongoDB version is 1.4.4 and MongoDB-CSharp driver is built on my own
which has been downloaded 3 days before.
Any suggestions is appreciated.
-- var descriptor =
_configuration.SerializationFactory.GetObjectDescriptor(typeof(T));
++ var descriptor =
_configuration.SerializationFactory.GetObjectDescriptor(document.GetType());
As a result of the above modification, 'update document' doesn't become
to be wrapped by 'set'.
But I don't know whether this modification is collect.
Thanks.