-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Environment:Ubuntu 14.04 LTS
Ruby on Rails (Rails 4.2.2, Ruby 2.2.2)
Mongoid 5.0.0.beta
I'm trying to use the fields option on the find method as explained here:
https://github.com/mongodb/mongo-ruby-driver/wiki/Tutorial#selecting-a-subset-of-fields-for-a-query
On my Rails console I do something like:
client = Mongoid::Clients.default
client[:entities].find({},:fields=>["_id"]).to_a
and the result includes all fields from the Entity model. Same result as when I don't add the :fields parameter.
Is this an issue in how I'm requesting the fields to be returned or the option is being ignored and it's actually a bug?