Closed IceBotYT closed 3 years ago
Hello!
I am making a search function for my project using ExpressJS. The GET request will have parameters to search. A type, and the query. For example: http://localhost:3000/search?type=code&q=Google and with the find function, I get an error:
http://localhost:3000/search?type=code&q=Google
pwds.find({ req.params.type: req.params.q }) ^ SyntaxError: Unexpected token '.'
Is it possible to search for an object with a variable like this? Thanks!
Nevermind, I thought of a fix. Thanks!
Hello!
I am making a search function for my project using ExpressJS. The GET request will have parameters to search. A type, and the query. For example:
http://localhost:3000/search?type=code&q=Google
and with the find function, I get an error:Is it possible to search for an object with a variable like this? Thanks!