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

#pluck in memory should return nil values (non-compacted)

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 8.0.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Minor Change

      Currently, #pluck in memory (i.e. on embedded docs) compacts the result before returning, i.e. it removes any `nil` values.

      This is undesirable because:

      1. nil values are useful information, for example, if I want to compare # of nil vs. non-nil.
      2. The number of plucked results returned may not match the number of documents.
      3. Mongoid::Criteria#pluck (aggregable) does return nil values, so memory pluck is not consistent with Mongoid.
      4. ActiveSupport's Array#pluck does return nil values.

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            shields@tablecheck.com Johnny Shields
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: