-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: CLI Module
-
3
-
Iteration Barcelona
-
Not Needed
Problem Description
Pasting invalid JS code into the shell gets into a bad state that it can't recover from without exiting.
Steps to Reproduce
- Open mongosh
- Paste the snippet below
var collName = 'somecoll'; var coll = db[collName]; - coll.drop(); coll.insertOne({'val': 'abc'}); - var pipeline = [ {"$unset": [ "_id", ]}, {"$merge": { "into": collName, "on": "_id", "whenMatched": "fail", "whenNotMatched": "insert" }}, ]; - for (let i=0; i<3; i++) { coll.aggregate(pipeline).next(); print(new Date() + ' - Count: ' + coll.countDocuments({}) + ', Size: ' + coll.stats().totalSize); }
Expected Results
Errors are displayed, prompt is back and things work just fine.
Actual Results
Additional Notes
- related to
-
MONGOSH-691 Copy and pasting large JSON causes screen to flash for many seconds.
- Closed