E
E
exxagw2018-02-27 21:22:31
JavaScript
exxagw, 2018-02-27 21:22:31

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

1 answer(s)
A
Abigovor, 2018-04-10
@Abigovor

take a look at https://www.npmjs.com/package/node-odata
, of course, not everything is implemented in it, the todo list is large, but everything you need is there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question