Answer the question
In order to leave comments, you need to log in
Query transformation for mongodb in express?
Found 2 packages:
1) https://www.npmjs.com/package/mongo-querystring
which can turn:
?foo=>10 === { foo: { $gt: 10 }}
?foo=!bar ==
= { foo
: {
$ ne: "bar" }} choose name and it works with pagination.
Is there really no good middleware for everything at once? well, for example:
1) ?q[][ne]=1 turns into { : { $ne: 1}}
2) catches the necessary/not necessary fields to display select: { title: 1, desc: -1 }
3) understands pagination
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question