[SERVER-1041] Add option to set default limit on find in shell Created: 22/Apr/10  Updated: 12/Jul/16  Resolved: 23/Apr/10

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 1.5.1

Type: New Feature Priority: Minor - P4
Reporter: Dave Syer Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

The default limit for find in the shell is apparently 20, which is a nice default, but if I am just browsing / experimenting with the shell it tends to mean that the data scrolls off the top of the terminal and I can't see the command I just wrote. Apparently the protocol supports setting the limit per request, so that would work per client as well.



 Comments   
Comment by auto [ 23/Apr/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: control shell batch size DBQuery.shellBatchSize = 2 SERVER-1041
http://github.com/mongodb/mongo/commit/32c403d752d2530e090bb4acbc7117d4fa96efa0

Comment by Eliot Horowitz (Inactive) [ 23/Apr/10 ]

> DBQuery.shellBatchSize = 2

Comment by Dave Syer [ 23/Apr/10 ]

Yeah, that must be it. The batch size. Didn't know what to call it.

Comment by Eliot Horowitz (Inactive) [ 23/Apr/10 ]

Do you mean the display batch size?
That's very different than limit.

If so - yes, that's pretty easy to make configurable.

Comment by Dave Syer [ 22/Apr/10 ]

That wasn't what I meant (so it doesn't work as designed). Matthias just said it was easy to do this. If it isn't then fine.

Comment by Eliot Horowitz (Inactive) [ 22/Apr/10 ]

you can use .limit

so

db.foo.find().limit(5)

Generated at Thu Feb 08 02:55:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.