Query.prototype.find()
Parameters
[filter] «Object|ObjectId» mongodb selector. If not specified, returns all documents.
[callback] «Function»
Returns:
- «Query» this
Find all documents that match selector
. The result will be an array of documents.
If there are too many documents in the result to fit in memory, use Query.prototype.cursor()
Example
// Using async/await
const arr = await Movie.find({ year: { $gte: 1980, $lte: 1989 } });
// Using callbacks
Movie.find({ year: { $gte: 1980, $lte: 1989 } }, function(err, arr) {});
当前内容版权归 mongoosejs 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 mongoosejs .