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

Size operator is broken

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 12_01_17
    • Component/s: None
    • Labels:
      None

      Description

      As if https://jira.mongodb.org/browse/SERVER-478 were not enough, here's another one (I'm not sure if it's a Mongoid or MongoDB issue):

      `
      Item.where(element_ids: {'$size' => {'$eq' => 0}}).count
      Item.where(element_ids: {'$size' => {'$eq' => 1}}).count
      Item.where(element_ids: {'$size' => {'$eq' => 2}}).count
      Item.where(element_ids: {'$size' => {'$eq' => 3}}).count
      Item.where(element_ids: {'$size' => {'$ne' => 0}}).count
      Item.where(element_ids: {'$size' => {'$ne' => 1}}).count
      Item.where(element_ids: {'$size' => {'$ne' => 2}}).count
      Item.where(element_ids: {'$size' => {'$ne' => 3}}).count
      `

      All these queries return exact same result, which is correct for the first query but wrong for all others.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            emirkin Eugene Mirkin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: