Skip to content

MONGOID-5399 / 5400 / 5148: Mongoid::Criteria #map should take a splat of field args + yield args to block #5346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add release note
  • Loading branch information
johnnyshields committed Jun 26, 2022
commit 27e12e4544c9c206cc1c0fcf8d4c0d9697da1dbb
12 changes: 12 additions & 0 deletions docs/release-notes/mongoid-8.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,18 @@ Mongoid 7 behavior:
end


``Mongoid::Criteria#map`` Supports Multiple Fields
--------------------------------------------------

``Mongoid::Criteria#map`` now supports multiple field arguments as a splat.
The behavior in this case is identical to ``#pluck``.

.. code-block:: ruby

Dinosaur.all.map(:name, :color)
#=> [ ['Velociraptor', :green], ['Tyrannosaurus Rex', :brown] ]


Removed ``:drop_dups`` Option from Indexes
------------------------------------------

Expand Down