如何在 mongodb 文档中的数组内创建第二个标识符
我正在尝试收集用户, 每个用户都有 MongoDB 的 _id 和姓名、邮件、任务数组和待办事项数组, 我想在数组中为每个任务和待办事项都有一个标识符
I am trying to make a collection of users,
each user has _id of MongoDB and name, mail and array of tasks and array of todos,
I want to have an identifier for each task and todo inside their arrays
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
任务和待办事项数组可以是文档数组,因此每个任务和待办事项都可以有一个 id 和一个值:
The arrays of tasks and todos could be an array of documents, so each task and todo could have an id and a value: