Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-38691

serverInfo not present in explain output for aggregation

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v4.2, v4.0, v3.6
    • Sprint:
      Query 2019-11-04, Query 2019-11-18

      Description

      Explain output for find commands include a  serverInfo object that contains version information:

      > db.foo.explain().find().finish().serverInfo
      {
      	"host" : "MacBook-Pro.local",
      	"port" : 27017,
      	"version" : "4.1.4",
      	"gitVersion" : "2f4b5918497b09a226a3ec5dcff930edd52ea1e9"
      } 

      However, this information is not available for aggregation commands:

      > db.foo.explain().aggregate([])
      {
      	"stages" : [
      		{
      			"$cursor" : {
      				"query" : {
      					
      				},
      				"queryPlanner" : {
      					"plannerVersion" : 1,
      					"namespace" : "test.foo",
      					"indexFilterSet" : false,
      					"parsedQuery" : {
      						
      					},
      					"queryHash" : "8B3D4AB8",
      					"winningPlan" : {
      						"stage" : "COLLSCAN",
      						"direction" : "forward"
      					},
      					"rejectedPlans" : [ ]
      				}
      			}
      		}
      	],
      	"ok" : 1
      } 

      This would be helpful to include for more complete information when troubleshooting .

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              david.percy David Percy
              Reporter:
              christopher.harris Christopher Harris
              Participants:
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: