restheart icon indicating copy to clipboard operation
restheart copied to clipboard

Allow passing Mongo REST AP GET /coll parameters such as filter, sort, keys, hint via headers

Open ujibang opened this issue 8 months ago • 1 comments

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

ujibang avatar Dec 04 '23 17:12 ujibang

we do have an example that does exactly this https://github.com/SoftInstigate/restheart/blob/master/examples/x-headers-to-qparams/README.md

ujibang avatar Apr 17 '24 08:04 ujibang