These are chat archives for Automattic/mongoose

7th
May 2018
Arun Gadag
@arun-awnics
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
@arun-awnics
May 07 2018 09:14
@lineus Any help?
Don Schrimsher
@donald-s
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
@arun-awnics
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
@jplew
May 07 2018 22:42
maybe try filtering them: filter(result => result)