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

Allow count to work with query hints

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.5.5
    • Affects Version/s: 1.8.0-rc0
    • Component/s: None
    • None
    • Environment:
      Redhat 6.0
    • Fully Compatible

      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.

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

              Created:
              Updated:
              Resolved: