Commit 5e56f7bc authored by Vadym Gidulian's avatar Vadym Gidulian

Added query parameter to `GET /:collection`

parent 2dbdc34f
...@@ -102,7 +102,7 @@ app.put('/:collection/:id', (req, res) => { ...@@ -102,7 +102,7 @@ app.put('/:collection/:id', (req, res) => {
}); });
app.get('/:collection', (req, res) => { app.get('/:collection', (req, res) => {
mongoSafeConnect(res, client => { mongoSafeConnect(res, client => {
client.db(DB_NAME).collection(req.params.collection).find().toArray((err, result) => { client.db(DB_NAME).collection(req.params.collection).find(req.body.query).toArray((err, result) => {
if (err) throw err; if (err) throw err;
res.status(200).send(result); res.status(200).send(result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment