假设我们有以下电影收藏
我们应该支持两种查询类型:
我们有1000万部电影,每部电影都有50个章节和1000个标签 查询时间应少于1秒
感谢您的帮助
示例文档:
[
{"my_id":273647,
"project":"XYZ",
"upload_date":{
"$date":"2019-05-19T13:05:31.000Z"
},
"path":"/path/to/my/data",
"start_FrameID":1000,
"end_FrameID":10000,
"sensors":[
{
"calibration_status":{
"yawFull_dif":0.6,
"autofix_injection":4,
"horizonFull_dif":0.0,
"roll_dif":0.6
},
"sesnsor_definition":{
"name":"main",
"type":"camera",
"model":"4083"
}
}
],
"pices":[
{
"name":"CHAP_A",
"start_FrameID":1000,
"end_FrameID":2000
},
{
"name":"CHAP_B",
"start_FrameID":2000,
"end_FrameID":3000
},
....,
{
"name":"CHAP_Z",
"start_FrameID":9000,
"end_FrameID":10000
}
],
"lable":[
{
"name":"Table",
"start_FrameID":1000,
"end_FrameID":3000
},
{
"name":"Car",
"start_FrameID":1000,
"end_FrameID":1500
},
{
"name":"House",
"start_FrameID":9500,
"end_FrameID":10000
}
],
...,
...
]
示例查询
结果应为:
[{"name":"CHAP_A","start_FrameID":1000,"end_FrameID":2000}]
结果应为:
[{"name":"CHAP_A","start_FrameID":1000,"end_FrameID":2000},{"name":"CHAP_Z","start_FrameID":9000,"end_FrameID":10000}]
结果应为:
[{"_id":{"$oid":"5ceba2a24a43015c5e900cd2"},...,"start_FrameID":1000,"end_FrameID":1500}]
结果应为:
{"_id":{"$oid":"5ceba2a24a43015c5e900cd2"},...,"start_FrameID":9500,"end_FrameID":10000}]
顺便说一句 我们正在使用MongoDB 4.0 我尝试使用$ expr和$ eleMatch,但没有成功