我在DB中有这个架构
# app_data:
{
"_id": ObjectId("fff... "),
"name": "App1",
"customer": ObjectId("abc... ")
}
# customer:
{
"_id": ObjectId("abc... "),
"name": "Oskar Arenas",
"telephone_number": "567567546"
}
我想要检索:
{
"name": "App1",
"customer_data": {
"_id": ObjectId("abc... "),
"name": "Oskar Arenas",
"telephone_number": "567567546"
}
}
是否有任何mongodb函数可以在单个查询中获取数据而不是ObjectId?