-
Type: Task
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: EJSON
Details
In the BSON library our EJSON stringifiy method defers to JSON.stringify for JS Map serialization which doesn't support inspecting the keys internal to a Map. We should add support that mirrors the support in BSON to fetch the key value pairs out of a Map and turn it into a JSON string.
Non-string keys should throw an error.
NODE-4122 Is related, fixing the replacer logic would likely make adding map support straight forward. (if map -> Object.fromEntries(map))
AC
- EJSON.stringify will turn Maps into the typical curly braced key value pair sequence of a JSON object
- Add tests equivalent to our BSON map usage
- related to
-
NODE-4122 EJSON prevents replacer from working on unsupported values
- Backlog