Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-2645

Mongoid 3 count caching bug.

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.0.16
    • Affects Version/s: None
    • Component/s: None

      This bug exists only in Mongoid 3 (testing on 3.0.15). Mongoid 2 doesn't have the bug.

      >> foo = Region.all.cache
      #<Mongoid::Criteria
      selector: {}
      options: {:cache=>true}
      class: Region
      embedded: false>

      >> foo.count
      MOPED: 127.0.0.1:27017 COMMAND database=gocheap_test command={:count=>"regions", :query=>{}} (0.4489ms)
      2

      >> foo.count
      MOPED: 127.0.0.1:27017 COMMAND database=gocheap_test command={:count=>"regions", :query=>{}} (0.4392ms)
      2

      So caching stopped working for counts.

            Assignee:
            Unassigned Unassigned
            Reporter:
            exoth Yuriy Trofimenko
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: