📌  相关文章
📜  在猫鼬中找到一种方法 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:48.786000             🧑  作者: Mango

代码示例1
// Find one adventure whose `country` is 'Croatia', otherwise `null`
await Adventure.findOne({ country: 'Croatia' }).exec();

// using callback
Adventure.findOne({ country: 'Croatia' }, function (err, adventure) {});

// select only the adventures name and length
await Adventure.findOne({ country: 'Croatia' }, 'name length').exec();