-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: bson-4.0.3
-
Component/s: EJSON
-
None
-
Empty show more show less
While looking into CLOUDP-62356, I encountered the following scenarios:
EJSON.stringify({ intField: 222}) = "{ intField: 222 }"
EJSON.stringify({ intField: Int32{ value: "222") = "{ "intField": "222" }"}}
EJSON.stringify({ intField: Int32{ value: "222" } }, { relaxed: false }) = "{ "intField": { "$numberInt": "222" } }"
In the second situation, it seems like the desired output would be:
EJSON.stringify({ intField: Int32{ value: "222" } }) = "{ "intField": 222 }"
with no quotes around 222 like in the first example. Otherwise, it gets recognized as a string when passed back into EJSON.parse.
- duplicates
-
NODE-2613 strict parsing of extended JSON $numberInt reads value as string
- Closed