spread syntax in .find() method in mongoose 7.0.2 #13194
-
Hi everyone! When working with mongoose 7.0.2, this code stops working and no matter the method, I can't use spread syntax as a query, it always returns an empty array. the code (works with "mongoose": "^6.3.1"):
the query: localhost:8800/api/hotels?featured=true&limit=4 does anyone know how to fix it or what I'm doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
-
thank you @vkarpov15 ! |
Beta Was this translation helpful? Give feedback.
const { min, max, limit, ...others } = req.query;
. I suspect thatlimit
is ending up in your query filter. This is due to the strictQuery changes in Mongoose 7.