db album explain count _status_photos ok queryPlanner winningPlan stag

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
> db.album.explain().count({_status_photos: 'ok'})['queryPlanner']['winningPlan']
{
"stage" : "COUNT",
"inputStage" : {
"stage" : "COUNT_SCAN",
"keyPattern" : {
"_status_photos" : 1,
"album_id" : 1
},
"indexName" : "_status_photos_1_album_id_1",
"isMultiKey" : false,
"multiKeyPaths" : {
"_status_photos" : [ ],
"album_id" : [ ]
},
"isUnique" : false,
"isSparse" : false,
"isPartial" : false,
"indexVersion" : 2,
"indexBounds" : {
"startKey" : {
"_status_photos" : "ok",
"album_id" : { "$minKey" : 1 }
},
"startKeyInclusive" : true,
"endKey" : {
"_status_photos" : "ok",
"album_id" : { "$maxKey" : 1 }
},
"endKeyInclusive" : true
}
}
}
> db.album.explain().count({_status_photos: null})['queryPlanner']['winningPlan']
{
"stage" : "COUNT",
"inputStage" : {
"stage" : "FETCH",
"filter" : {
"_status_photos" : {
"$eq" : null
}
},
"inputStage" : {
"stage" : "IXSCAN",
"keyPattern" : {
"_status_photos" : 1,
"album_id" : 1
},
"indexName" : "_status_photos_1_album_id_1",
"isMultiKey" : false,
"multiKeyPaths" : {
"_status_photos" : [ ],
"album_id" : [ ]
},
"isUnique" : false,
"isSparse" : false,
"isPartial" : false,
"indexVersion" : 2,
"direction" : "forward",
"indexBounds" : {
"_status_photos" : [
"[undefined, undefined]",
"[null, null]"
],
"album_id" : [
"[MinKey, MaxKey]"
]
}
}
}
}