Please sir! if you can help. People are encountering a common issue with the sort and limit logics, i inclusive. The both of them are returning null, empty array, when we run it in postman.
@@Tech_bro-i5g i explained the solve in comments of this and previous video add this line of codes: delete queryObj.sort delete queryObj.fields before the "let query = Movie.find(queryObj) " Because mongoose trying to fetch the documents that match with the parameters entered the query string, in that case it can't find anything and returns null
10:40 In Mongoose 8.x.x You can mix between inclusion and exclusion fields
🙏💯
Please sir! if you can help. People are encountering a common issue with the sort and limit logics, i inclusive. The both of them are returning null, empty array, when we run it in postman.
I am using the mongoose 8.0.3 version , will req.query.sort or req.query.fields ..will work ..as I am not getting the desired results
I am using the same version, have you resolved your issue?
@@Tech_bro-i5g i explained the solve in comments of this and previous video
add this line of codes:
delete queryObj.sort
delete queryObj.fields
before the
"let query = Movie.find(queryObj) "
Because mongoose trying to fetch the documents that match with the parameters entered the query string, in that case it can't find anything and returns null
Have you resolved this :)
@@acupoflie thanks bro
I had '__v' removed before I even wrote the excluding code.
Have you resolved your issue?
Why is it returning null
Mine is also returning null. Have you resolved your issue?
@@Tech_bro-i5g i guess dont pass any parameter to .fin() method