.skip()
Indicate the number of records to skip before returning the results from executing a query instance.
.skip(numRecordsToSkip)
Argument | Type | Details | |
---|---|---|---|
1 | numRecordsToSkip | The number of records to skip. |
To retrieve records for all but the original user named Jake:
var fakeJakes = await User.find({ name: 'Jake' });
.skip(1);
return res.json(fakeJakes);
If the “skip” value is greater than the number of records matching the query criteria, the query will return an empty array. The .find() method returns a chainable object if you don't supply a callback. This method can be chained to .find() to further filter your results.