What does skip() do?
skip() skips the given number of documents in the query's result.
Example:
js
db.users.find().skip(10)This query skips the first 10 documents and returns everything after them.
Where it's used:
-
in pagination, together with
limit()jsdb.users.find().skip(10).limit(5) -
skip 10, show the next 5 (e.g. page 3)
Summary: skip() lets you skip part of the results and start returning data from a specific point.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.