RoboMongo: Doesn't display all documents

Viewed 13980

When I open a collection, it only displays the first 50 documents rather then all of them. How do I make it so that RoboMongo display all documents in the collection (preferably automatically)?

robomongo result

3 Answers

UPDATE 06 december 2019: The initial solution is not working from the v1.3.1 of Robomongo. If you enter 0, Robomongo will throw an error. See the EDIT 1 for new solution.

There is an input at the upper right which gives you the possiblity to change the number of displayed documents, just under the query. Change it to 0 and press Enter. It'll load all documents.

The input buttons

Even if the 50 reappears after, you have all documents displayed.

EDIT 1: The above seems to be fixed in the newer releases (from v1.3.1).

As suggested by @learnsomemore in the comments, you can add DBQuery.shellBatchSize = 500; before your query to change the returned array size.

This was originaly given in a comment by @davidm06 in the GitHub issue "Aggregate only shows 50 results #1157" from the RoboMongo public repository.

You can also use toArray() at the end to get the whole result at once.

example toArray()

You can change the default batch size:

  • Edit robomongo.json (in ~/.config/robomongo/<version>/ on Linux/MacOS, in c:\Users\YourName\.config\<version>/ on Windows)
  • Change the batchSize attribute, you can choose a value of fixed size (e.g. 100) or choose 0 to mean "all documents" (h/t to @PaulRey though I've had mixed results in using this symbolic, see comments below this question):

    {
      "batchSize" : 100,
      ...
    }
    
  • Save robomongo.json and restart RoboMongo

This allows you to increase the default batch size albeit at the potential cost of waiting longer for results.

More details in the docs.

Related