restheart
restheart copied to clipboard
Allow passing Mongo REST AP GET /coll parameters such as filter, sort, keys, hint via headers
Brief overview
the Mongo REST API allows querying collections via GET /coll?filter={...}&sort={...}&keys&hint={...}
specifying query parameters using query parameters.
Allow to pass the same parameters via headers as well.
Rationale
This feature increases the security (because headers are encrypted) and simplify handling special chars (chars that need to url encoded).
Example
GET /coll/filter={"_id": {"$regex": { "^.*<variable>" }}
If <variable> = "
or <variable> = \
or <variable> = +
the request fails. The variable must be encoded or quoted. This makes complex building dynamically queries.
Detailed documentation
TBD
we do have an example that does exactly this https://github.com/SoftInstigate/restheart/blob/master/examples/x-headers-to-qparams/README.md