/* sample collection items */
{
"_id" : ObjectId("56e1b0520ba71ca0485a386a"),
"uid" : 9843,
"sub" : {
"date" : ISODate("2016-03-09T22:54:09.549+08:00"),
"status" : "PLACE_ORDER_SUCCESS",
"arr" : {
"taskids" : [],
"ids" : [
"56c56639ef68fc0e28524aab",
"56c5663aef68fc0e28524ab6",
"56c5663aef68fc0e28524ab7",
"56c5663aef68fc0e28524ab8",
"56c5663aef68fc0e28524ab9"
]
}
}
}
/* sample index */
{
"uid" : -1,
"sub.status" : 1,
"sub.arr.ids" : 1,
"sub.date" : 1
}
/* sample search explain */
db.getCollection('sample').find({ "uid" : 9843,
"sub.date" : new Date(1456239231000),
"sub.status" : "PLACE_ORDER_SUCCESS",
"sub.arr.ids" : "56c56639ef68fc0e28524aab"
}).explain()
/* sample index have 2 miss */
{
"uid" : [
"[9843.0, 9843.0]"
],
"sub.status" : [
"[MinKey, MaxKey]"
],
"sub.arr.ids" : [
"[\"56c56639ef68fc0e28524aab\", \"56c56639ef68fc0e28524aab\"]"
],
"sub.date" : [
"[MinKey, MaxKey]"
]
}
/* sample_root collection items */
{
"_id" : ObjectId("56e1b0520ba71ca0485a386a"),
"uid" : 9843,
"date" : ISODate("2016-03-09T22:54:09.549+08:00"),
"status" : "PLACE_ORDER_SUCCESS",
"arr" : {
"taskids" : [],
"ids" : [
"56c56639ef68fc0e28524aab",
"56c5663aef68fc0e28524ab6",
"56c5663aef68fc0e28524ab7",
"56c5663aef68fc0e28524ab8",
"56c5663aef68fc0e28524ab9"
]
}
}
/* sample_root index */
{
"uid" : -1,
"status" : 1,
"arr.ids" : 1,
"date" : 1
}
/* sample_root search explain */
db.getCollection('sample_root').find({ "uid" : 9843,
"date" : new Date(1456239231000),
"status" : "PLACE_ORDER_SUCCESS",
"arr.ids" : "56c56639ef68fc0e28524aab"
}).explain()
/* sample_root match all */
{
"uid" : [
"[9843.0, 9843.0]"
],
"status" : [
"[\"PLACE_ORDER_SUCCESS\", \"PLACE_ORDER_SUCCESS\"]"
],
"arr.ids" : [
"[\"56c56639ef68fc0e28524aab\", \"56c56639ef68fc0e28524aab\"]"
],
"date" : [
"[new Date(1456239231000), new Date(1456239231000)]"
]
}