Expand description
Parse JSON to BSON and back.
Upstream: src/Adapters/Storage/Mongo/MongoTransform.js. It is full of load-bearing special
cases, and those special cases are the whole job: the naive transform is trivial and wrong.
The pair implemented here mirrors parseObjectToMongoObjectForCreate and
mongoObjectToParseObject, which are the two functions upstream exports and therefore the
two this can be differentially tested against. See tests/transform_differential.rs.
Scope is the 0.1.0 field set: String, Number, Boolean, Date, Array, Object, Pointer, ACL.
Functionsยง
- mongo_
object_ to_ parse mongoObjectToParseObject.- parse_
object_ to_ mongo_ create parseObjectToMongoObjectForCreate.- storage_
key - Keys that are renamed rather than stored under their Parse name (
transformKey,MongoTransform.js:7-30). The list is closed: everything else keeps its name, except a declared Pointer field, which takes a_p_prefix. - value_
to_ bson_ for_ query - Lower a value for use in a query filter on
field.