I want to use the below query to access all the records in a collection in MongoDB using the RMongo package in R. dbGetQuery(mongo, "", "{}") The collection has a large number of documents and more and more documents get added to it everyday and hence I dont get to know how many documents are there in the collection beforehand. So I cannot specify a limit in the above query. But since the default value is 1000, it retrieves only 1000 documents from the collection. How can I retrieve all the documents in a collection without specifying a limit?
Had the same issue and the answer was surprisingly simple - just set the limit to Inf:
result <- dbGetQuery(mongo, collection, query, skip=0, limit=Inf)