When converting BSON to JSON and extended JSON, bson_utf8_escape_for_json() should be used to escape strings for the regex, symbol, and DBPointer types. Escaping is currently done for keys, UTF-8 strings, code (w/ and w/o scope) types.
Note: escaping regex patterns with bson_utf8_escape_for_json() causes the following BSON corpus test case to fail: regex with slash. JSON does not require forward slashes to be escaped, so this may mean that bson_utf8_escape_for_json() is too aggressive.
- is related to
-
CDRIVER-2208 Introduce new API for Extended JSON spec 2.0 output
- Closed
- related to
-
CDRIVER-2128 Support revised Extended JSON spec
- Closed