devconnector_2.0 | Social network for developers , built on the MERN stack | Runtime Evironment library
kandi X-RAY | devconnector_2.0 Summary
kandi X-RAY | devconnector_2.0 Summary
Social network for developers, built on the MERN stack
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Verifies the request
devconnector_2.0 Key Features
devconnector_2.0 Examples and Code Snippets
Community Discussions
Trending Discussions on devconnector_2.0
QUESTION
I recently started learning express and mongoose, but I'm not sure if I should be doing things the way I am. I followed a tutorial to handle posts, each post can have likes and comments, my model looks like this one from the tutorial. Mongoose Post Model
But I want lazy load my comments (like a Facebook post) when I open a post using skip and limit, the question is should I have the comments on another document or can I skip and limit inside of those comments?
Post.find({ id: req.params.id, comments: {skip: 0, limit: 10}})???
...ANSWER
Answered 2020-Mar-04 at 07:09Take a look at this answer: Skip and Limit on nested array element
As the example, you should use SLICE
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install devconnector_2.0
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page