I have millions of records in collection . I have created a scheduled trigger which will run every minute . On trigger function i am retrieving 1000 records then updating it . Below is the query i have used
The collection.find() method returns a cursor object that points to any documents that match the specified query.
You can manipulate and access documents in the query result set with the cursor methods mentioned in the documentation linked above but it does not yet have batchSize() as a method to work off. However, in saying so, can you detail the use for batchSize in this scenario? You may wish to create a feedback request for this as well in which others can vote for.
Could it be that the full query itself is returning 101 documents that match? i.e. There are no more than 101 documents that match.