RejectedSoftware Forums

Sign up

mongocursor snapshot

Is there a way to execute a method "snapshot" at the cursor mongodb ? http://docs.mongodb.org/manual/reference/method/cursor.snapshot/

Re: mongocursor snapshot

Am 01.02.2015 um 08:09 schrieb semibug:

Is there a way to execute a method "snapshot" at the cursor mongodb ? http://docs.mongodb.org/manual/reference/method/cursor.snapshot/

There is currently no high level method for that, but you can construct
your own query document with custom options like this:

Bson q = Bson.emptyObject;
q["query"] = ...; // the actual query goes here
q["snapshot"] = 1.0;
collection.find(q);

If this doesn't work, it's possible that snapshot() does something
else than adding a "snapshot" parameter. The "mongosniff" utility or
setting the mongo server to verbose logging should give a hint in that case.