问题
I am having weird issue with mongo cursor. I am using casbah to access Mongo through Scala code. I have following code:
val cur = collection.find(MongoDBObject("brand" -> "someBrand")
val items = cur.toList.map(dbo => ScalaJack.readDB [ T ] (dbo))
I have 387 item in the db that should be returned with the query above. But it is returning 364 items only. When I checked the size of cur
it is 387, but when I checked the size of cur.toList
it is 364.
I am not sure why doing toList
on cursor is decreasing the size. What might cause it?
来源:https://stackoverflow.com/questions/23410483/mongocursor-size-is-decreasing-when-it-is-converted-to-list-using-tolist