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

pluck method modifies existing array

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

      Using the pluck method modifies the current array to only return the plucked field.

      @foos= Foo.all
      ids = @foos.pluck(:_id)
      

      In this example, @foos has been modified to return as if I had done:

      @foos= Foo.all.only(:_id)
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            cpuguy83 cpuguy83
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: