From d89e58fd340ced9370d1a39a4334a42a77005f5e Mon Sep 17 00:00:00 2001 From: David Storch Date: Wed, 20 May 2015 13:46:50 -0400 Subject: SERVER-16265 add query predicate and aggregation command to the getMore slow query log / profile entries --- src/mongo/db/clientcursor.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/clientcursor.h') diff --git a/src/mongo/db/clientcursor.h b/src/mongo/db/clientcursor.h index a94700234d2..f5350ff5707 100644 --- a/src/mongo/db/clientcursor.h +++ b/src/mongo/db/clientcursor.h @@ -148,6 +148,7 @@ namespace mongo { PlanExecutor* getExecutor() const { return _exec.get(); } int queryOptions() const { return _queryOptions; } + const BSONObj& getQuery() const { return _query; } // Used by ops/query.cpp to stash how many results have been returned by a query. int pos() const { return _pos; } @@ -230,7 +231,9 @@ namespace mongo { // How many objects have been returned by the find() so far? int _pos; - // The query that prompted this ClientCursor. Only used for debugging. + // If this cursor was created by a find operation, '_query' holds the query predicate for + // the find. If this cursor was created by a command (e.g. the aggregate command), then + // '_query' holds the command specification received from the client. BSONObj _query; // See the QueryOptions enum in dbclient.h -- cgit v1.2.1