These are chat archives for Automattic/mongoose

May 2018
Arun Gadag
May 07 2018 07:12
Hi guys, mongoose returns either null or [] if it does not match the where clause during find(). Is there a way to skip these null/[] values in callback?
Arun Gadag
May 07 2018 09:14
@lineus Any help?
Don Schrimsher
May 07 2018 14:01
@arun-awnics Why do you want to skip these values in the callback? Can't you just ignore them?
Arun Gadag
May 07 2018 15:45
@donald-s No... I want to limit the data that I show on the front-end. I am implementing pagination. Hence the first page will retrieve only first 5 entries from the DB. Next page will display the next 5 and so on.
JP Lew
May 07 2018 22:42
maybe try filtering them: filter(result => result)