如何解决如何使用单个mongo数据库查询从3个不同的集合中检索数据?
寻求帮助
我在mongo DB中有3个不同的集合。
1.FormSubmissions 2.表格答案 3.FormQuestions
我想使用mongo DB从3个不同的集合中检索数据
我希望得到以下答复
[
{
"_id":{"$oid":"5f8d5e164f243b1d0e7c8a85"},"LanguageId":{"$oid":"5a6304ffc3c3f119fc0e60c9"},"FormId":{"$oid":"5da7f7dfa6334912bc30a3f5"},"FormVersionId":{"$oid":"5e4d43c19ee80910ef49a21c"},"SubmittedOn":{"$date":"2020-10-19T09:36:22.737Z"},"EmployeeId":{"$oid":"5e50b0843bd4c66692ee72c0"},"Name":"1212","Type":"Follow-up",},{
"_id":{"$oid":"5f8d5c7d4f243b1d0e7c88d7"},"SubmittedOn":{"$date":"2020-10-19T09:37:22.737Z"},"EmployeeId":{"$oid":"5e50afd33bd4c66692ee72b5"},"Name":"1111","Type":"NEW",}
]
表单提交收集数据
[
{
"_id":{"$oid":"5f8d5e164f243b1d0e7c8a85"},}
]
FormAnswers收集数据
[{
"_id":{"$oid":"5f8d5e164f243b1d0e7c8c27"},"FormSubmissionId":{"$oid":"5f8d5e164f243b1d0e7c8a85"},"Answers":[
{
"_id":{"$oid":"5f8d5e164f243b1d0e7c8a86"},"FormQuestionId":{"$oid":"5e4d476a9ee80910ef49a3d4"},"ElementType":11,"Value":"1212"
},{
"_id":{"$oid":"5f8d5e164f243b1d0e7c8a87"},"FormQuestionId":{"$oid":"5e4d476a9ee80910ef49a3d5"},"ElementType":8,"Value":"Follow-up"
}
]
},{
"_id":{"$oid":"5f8d5e164f243b1d0e7c8c27"},"FormSubmissionId":{"$oid":"5f8d5c7d4f243b1d0e7c88d7"},"Value":"1111"
},"Value":"NEW"
}
]
}]
FormQuestions收集数据
{
"_id":{"$oid":"5f857076d1e44f6af1adb526"},"Questions":[
{
"_id":{"$oid":"5e4d476a9ee80910ef49a3d4"},"Question":"Name","Index":0,{
"_id":{"$oid":"5e4d476a9ee80910ef49a3d5"},"Question":"Type","Index":1,}
]
}
谢谢。
寻求快速响应。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。