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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • mongodb-3.0
    • Affects Version/s: None
    • Component/s: manual
    • Labels:
      None

      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.

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

              Created:
              Updated:
              Resolved:
              8 years, 36 weeks, 6 days ago