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

system.profile query format inconsistent

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Backlog
    • Major - P3
    • Resolution: Unresolved
    • 2.2.7, 2.4.9, 2.6.0-rc1
    • None
    • Diagnostics, Querying, Usability
    • None
    • Query Execution

    Description

      There are several schemas for how queries with/without sort are stored in system.profile. This makes it unnecessarily complex to run aggregation over system.profile collections that access the query patterns.

      There should be a single common format for all queries.

      simple find, no sort : query on top level

      db.docs.find({a: 1})
       
      	"query" : {
      		"a" : 1
      	},

      find with sort, query is nested in another query field, without $.

      db.docs.find({a: 1}).sort({b:1})
       
      	"query" : {
      		"query" : {
      			"a" : 1
      		},
      		"orderby" : {
      			"b" : 1
      		}
      	},

      $query / $orderby syntax, results in nested $query field with $.

      db.docs.find({ $query: {a: 1}, $orderby: {b: 1} })
       
      	"query" : {
      		"$query" : {
      			"a" : 1
      		},
      		"$orderby" : {
      			"b" : 1
      		}
      	},

      Attachments

        Issue Links

          Activity

            People

              backlog-query-execution Backlog - Query Execution
              thomas.rueckstiess@mongodb.com Thomas Rueckstiess
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated: