Increasing mongosh line length output

Hey friends,

So, mongosh doesn’t like returning documents with very long lines but I have a large monitor and my text small. Does anyone know how to change it’s config so it can output longer lines on it’s query return rather than wrapping the document it returns onto multiple lines?


Welcome to the MongoDB community

I believe this helps you

–eval 'DBQuery.shellBatchSize = 1000; db.getSiblingDB(“DATABASE”).getCollection(“COOL”).find({}, {“value”:1, _id:0}).sort({“lastUpdated”: -1}).limit(1000) ’

Hi Samuel,

Thank you for your effort. the limit method changes the number of results you get but I am trying to change t the wrapping behaviour of the output lines.


Hi Harrison, I believe I expressed myself wrong. The item I commented was not about the limit but about the parameter DBQuery.shellBatchSize = 1000

Hi Samuel,

DBQuery.,shellBatchSize is the number of results that a cursor displays. I am looking to change the wrap behaviour of the shell.


Hi @Samuel_84194, can you provide an example or screenshot? This will help us better understand your question. In my environment, the text will only wrap at the end of the line.


I believe Harrison_Morrow means this.