|
When an explain is run on a pipeline that must execute entirely on mongoS, the result is an empty cursor batch rather than an explain plan:
mongos> db.adminCommand({explain: {aggregate: 1, pipeline: [{$listLocalSessions:
|
{}}], cursor: {}}})
|
{
|
"cursor" : {
|
"firstBatch" : [ ],
|
"id" : NumberLong(0),
|
"ns" : "admin.$cmd.aggregate"
|
},
|
"ok" : 1,
|
"$clusterTime" : {
|
"clusterTime" : Timestamp(1519932263, 2),
|
"signature" : {
|
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
|
"keyId" : NumberLong(0)
|
}
|
},
|
"operationTime" : Timestamp(1519932263, 2)
|
}
|
Instead, the output should be an explain plan indicating that this is a mongoS-only pipeline:
mongos> db.adminCommand({explain: {aggregate: 1, pipeline: [{$listLocalSessions: {}}], cursor: {}}})
|
{
|
"splitPipeline" : null,
|
"mongos" : {
|
"host" : "Bernards-MacBook-Pro-2.local:27017",
|
"stages" : [
|
{
|
"$listLocalSessions" : {
|
"allUsers" : false,
|
"users" : [
|
{
|
"user" : "",
|
"db" : ""
|
}
|
]
|
}
|
}
|
]
|
},
|
"ok" : 1,
|
"$clusterTime" : {
|
"clusterTime" : Timestamp(1520430504, 1),
|
"signature" : {
|
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
|
"keyId" : NumberLong(0)
|
}
|
},
|
"operationTime" : Timestamp(1520430504, 1)
|
}
|
|