-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: CLI Module
-
Iteration Octopus
-
Needed
-
Problem Statement/Rationale
What is going wrong?
Using printjson in mongosh will elide results after some point
{ _id: ObjectId("611a70f8f594232ec6f1147f"), a: 96 }, { _id: ObjectId("611a70f8f594232ec6f11480"), a: 97 }, { _id: ObjectId("611a70f8f594232ec6f11481"), a: 98 }, { _id: ObjectId("611a70f8f594232ec6f11482"), a: 99 }, ... 100 more items ]
Steps to Reproduce
How could an engineer replicate the issue you’re reporting?
database = db.getSiblingDB("test") coll = database.getCollection("test_col") coll.drop() for (let i = 0; i < 200; i++) { coll.insertOne({a:i}) } results = coll.find().toArray() printjson(results)
Expected Results
What do you expect to happen?
printjson should print all 200 items.
Actual Results
What do you observe is happening?
printjson only prints 100 items and truncates the rest.
Additional Notes
Any additional information that may be useful to include.
print(JSON.stringify(results)) will print all items but remove the wrapping ObjectId(...)
{"_id":"611a7117ba03c5c77dfa664b","a":101}
print(EJSON.stringify(results)) will print all items but will replace ObjectId with an key value pair "$oid": <ObjectId>
{"_id":{"$oid":"611a7117ba03c5c77dfa6678"},"a":146}
- is related to
-
MONGOSH-1352 Suppressed results from printJson in MongoSh
- Open
-
MONGOSH-1361 Expose and document `printjson` as `printfull`, add `printejson`
- Open