const posts = await Post.find().populate("receiver").populate("author")
try {
res.json({
status: true,
message: 'All posts fetched',
data: posts.reverse()
})
This is my code that sending all posts to frontend. But I want add lazy loading on backend. Backend must not send all the data at one go.. calling 1000 feed posts after sometime interval. The data will be too large to call via api.