node-mongo-querystring icon indicating copy to clipboard operation
node-mongo-querystring copied to clipboard

Escaping operators

Open Halt001 opened this issue 7 years ago • 0 comments

Hi, I've been playing a little with your lib but I found no way of escaping operators that occur in the first part of the values. For example, what would be the querystring for the following output: {"foo":"!baz"}.

I've tried: ?foo=!baz => {"foo":{"$ne":"baz"}} (duh) ?foo=%21baz => {"foo":{"$ne":"baz"}} (ExpressJS resolves %21 before your lib sees it) ?foo=%27!baz%27 => {"foo":"'!baz'"} same problem, resolved by ExpressJS

But even without ExpressJS in between % escaping it doesn't seem to work.

P.S. Like another poster I would also like to combine the whole expression into one q=... parameter, otherwise it would cause conflicts with other meaningful parameters like page, limit etc.

Halt001 avatar Aug 08 '17 05:08 Halt001