如何在“任务”数组中找到并返回与完成匹配的第一个子文档:真?
usingfindOne
返回整个文档.. 是否有返回子文档的另一个函数?
{
title: 'awebsite.com'
company: 'a company'
companyID: Random.id()
category: 'website'
starred: false
timeline: {
tasks: [
{
name: 'task1'
completed: true
todos: [
{todo: 'something', completed: false, todoID: Random.id()}
{todo: 'something', completed: false, todoID: Random.id()}
{todo: 'something', completed: false, todoID: Random.id()}
]
}
{
name: 'task2'
completed: false
todos: [
{todo: 'something', completed: false, todoID: Random.id()}
{todo: 'something', completed: false, todoID: Random.id()}
{todo: 'something', completed: false, todoID: Random.id()}
]
}
]
}
}