我在Mongo有一个文件,我希望根据某些标准获取。
我的LawCase文件
{
"_id" : ObjectId("5945f88c9a89205aae0efe9a"),
"category" : "DUI",
"updated_at" : ISODate("2017-06-18T03:50:36.825+0000"),
"created_at" : ISODate("2017-06-18T03:50:36.821+0000"),
"lawyer_ids" : [
"5945f88c9a89205aae0efe99"
]
}
我的律师文件
{
"_id" : ObjectId("5945f88c9a89205aae0efea8"),
"full_name" : "Some Name ",
"active" : true,
"updated_at" : ISODate("2017-06-18T03:50:36.849+0000"),
"created_at" : ISODate("2017-06-18T03:50:36.849+0000"),
"law_case_ids" : [
"5945f88c9a89205aae0efea9",
"5945f88c9a89205aae0efeac",
"5945f8b59a89205aae0f3f81",
"5955d0ff9a89200a57340db8"
]
}
假设我有数据,我需要获得50个文档,其中类别为'DUI',lawyer_id是唯一的。
任何提示?