When synchronously calling find on a collection I receive the correct total from count(), but when iterating using items() I am only ever able to get 101 documents
Create new Mongo client
var m = newMongo(server)
Connect to Mongo server
let connectResult = m.connect()
Specify collection
let collection = m[database][collection]
let cnow = getTime() - initDuration(days = 1)
echo cnow
let fetched = collection.find(%*{"upsertedAt": {"$lt": cnow}}, @[field])
let tally = fetched.count()
When synchronously calling find on a collection I receive the correct total from count(), but when iterating using items() I am only ever able to get 101 documents
Create new Mongo client
var m = newMongo(server)
Connect to Mongo server
let connectResult = m.connect()
Specify collection
let collection = m[database][collection] let cnow = getTime() - initDuration(days = 1) echo cnow let fetched = collection.find(%*{"upsertedAt": {"$lt": cnow}}, @[field]) let tally = fetched.count()
I get correct total of 1,821,187 documents
echo "Total: ", tally
BUT I only get 101 using the following
for c in fetched.items(): echo c["_id"]