-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
I've added a type check to the processing of the :fields options to skip the addition of :_type to the fields list if :field is a hash. This should maintain the current behavior as well as provide support for the $slice operator, which requires that :fields be a hash, not an array.
It is now possible to manipulate the range of subfields in a document. Compare the following:
Service.last.service_logs.count
=> 66
Service.all.extras(:fields => {:service_logs => {"$slice" => 10}}).last.service_logs.count
=> 10