-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: bson-4.3.0
This is more of an UX thing, but it would be nice if EJSON.stringify/serialize threw a more actionable error like JSON.stringify() when encountering circular input.
> const c = {}; c.c = c; <ref *1> { c: [Circular *1] } > require('bson').EJSON.serialize(c) Uncaught RangeError: Maximum call stack size exceeded at Function.isArray (<anonymous>) at serializeValue (/home/addaleax/src/mongosh/node_modules/bson/lib/extended_json.js:130:15) at serializeDocument (/home/addaleax/src/mongosh/node_modules/bson/lib/extended_json.js:203:26)
- related to
-
MONGOSH-709 Calling EJSON.stringify on a cursor results in stack overflow
-
- Closed
-
- links to