Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-5482

Document changes to db.currentOp() / profiler "query" field for getMore operations

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • mongodb-3.0
    • manual
    • None
    • DOCS Current Sprint (556)
    • true

    Description

      SERVER-16265 (fixed in the 3.1 dev series and backported to 2.6 and 3.0), changed the behavior of the db.currentOp() query field for getMore operations. Currently the documentation here states:

      query does not appear for op of "insert", and the query document can be empty for op types such as "getmore".

      This is no longer true. The query field will now appear for a getMore against a cursor for either a find or aggregation operation. If it is an aggregation cursor, the value of the query field will be the aggregation command BSONObj:

      		{
      			"desc" : "conn1",
      			"threadId" : "7f518f7a5700",
      			"connectionId" : 1,
      			"opid" : 477,
      			"active" : true,
      			"secs_running" : 2,
      			"microsecs_running" : NumberLong(2349253),
      			"op" : "getmore",
      			"ns" : "test.t",
      			"query" : {
      				"aggregate" : "t",
      				"pipeline" : [
      					{
      						"$match" : {
      							"a" : {
      								"$gt" : 1
      							}
      						}
      					}
      				],
      				"cursor" : {
      					"batchSize" : 0
      				}
      			},
      ....
      

      If it's a find operation, the query field will contain the query predicate:

      		{
      			"desc" : "conn1",
      			"threadId" : "7f518f7a5700",
      			"connectionId" : 1,
      			"opid" : 487,
      			"active" : true,
      			"secs_running" : 1,
      			"microsecs_running" : NumberLong(1560034),
      			"op" : "getmore",
      			"ns" : "test.t",
      			"query" : {
      				"a" : {
      					"$gt" : 1
      				}
      			},
      ....
      

      We will need to update the documentation similarly for the profiler output documented here. Again, the query field in the system.profile collection's getMore entries will now contain either the aggregation command specification or the query predicate.

      Attachments

        Issue Links

          Activity

            People

              kay.kim@mongodb.com Kay Kim (Inactive)
              david.storch@mongodb.com David Storch
              Jonathan Dahl Jonathan Dahl
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                6 years, 42 weeks ago