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

Allow count to work with query hints

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 1.8.0-rc0
    • Fix Version/s: 2.5.5
    • Component/s: None
    • Labels:
      None
    • Environment:
      Redhat 6.0
    • Backwards Compatibility:
      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

              Assignee:
              pasette Daniel Pasette
              Reporter:
              realzyy Yunyang Zhang
              Participants:
              Votes:
              20 Vote for this issue
              Watchers:
              16 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: