Created
August 21, 2018 16:39
-
-
Save rbezerra/b38ad7359383dd661de101a9d374108a to your computer and use it in GitHub Desktop.
utilizando o operador $in no mongoose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.get('/recomendados/:lista', async(req, res) => { | |
| const lista = JSON.parse(req.params.lista); | |
| await Sound.find({"genre":{ $in: lista}}, (err, sounds) => { | |
| if(err) return res.json(err); | |
| res.json(sounds); | |
| }) | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment