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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: mongodb-3.0
    • Component/s: manual
    • Labels:
      None
    • Last comment by Customer:
      true
    • Sprint:
      DOCS Current Sprint (556)

      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

              Assignee:
              kay.kim Kay Kim (Inactive)
              Reporter:
              david.storch David Storch
              Participants:
              Last commenter:
              Jonathan Dahl Jonathan Dahl
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved:
                Days since reply:
                6 years, 7 weeks, 6 days ago
                Date of 1st Reply: