-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 3.2, 3.2.1
-
Component/s: None
-
None
-
Environment:OSX, MongoDB 3.2, WiredTiger
Trying to get batch_size to be 1 to ensure I don't cache any results. The following works in Javascript but the python equivalent doesnt.
import pymongo connection = pymongo.MongoClient() mycoll = connection.test.mycoll mycoll.drop() mycoll.insert({'x':1,'v':False}) mycoll.insert({'x':2,'v':False}) c = mycoll.find().batch_size(1) next(c,None) mycoll.update({'x':2},{'$set':{'v':True}}) next(c,None)
When printing the second record - I expect to get back the record that has been changed. I seem to be seeing a version prior to the change even though I have no batch size set.
In Javascript 0 it works
db.mycoll.drop() db.mycoll.insert({x:1,v:false}) db.mycoll.insert({x:2,v:false}) var c = db.mycoll.find().batchSize(1) c.next() db.mycoll.update({x:2},{$set:{'v':true}}) c.next()