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

Allow count to work with query hints

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • 1.8.0-rc0
    • 2.5.5
    • None
    • None
    • Redhat 6.0
    • Fully Compatible

    Description

      Add ability to hint count commands.

      // using explicit command form
      db.runCommand({count:'test', query:{f:1}, hint:'_id_'})
       
      // using shell helper
      db.test.find({f:1}).hint('x_1').count()
      

      If there is no predicate for the query given to the count command, the hint will be ignored and the result will be pulled directly from the collection metadata.

      Attachments

        Issue Links

          Activity

            People

              dan@mongodb.com Daniel Pasette (Inactive)
              realzyy Yunyang Zhang
              Votes:
              20 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: