am I correct in that MongoDB map/reduce feature is not available on Mongoid Criteria for MongoId version 2+
Can any one confirm this I have a criteria
Here my Query
class PerformerSource
scope :active_performers,where(:active => true).only([:performer_id, :sort_order,:stage_name, :photo, :large_photo, :status, :current_performance_type,:current_sign_in_at])
end
PerformerSource.active_performers.order_by([:sort_order,:desc])
I want to apply map/reduce function to it
something like this
PerformerSource.active_performers.order_by([:sort_order,:desc]).map_reduce(PerformerSource.map,PerformerSource.reduce)
but whenever I do this it return with error
NoMethodError: undefined method `map_reduce' for #
Checking if the map/reduce is available at all
PerformerSource.active_performers.order_by([:sort_order,:desc]).respond_to?(:map_reduce)
=> false
PerformerSource.respond_to?(:map_reduce)
=> false
So am I correct in my believe since I see Mongoid-3 has a provision of adding map/reduce in Mongoid-criteria over here but cant find the same in mongoid 2
I can upgrade mongoid (I wish I could) since the application is running on Ruby-1.8.7 and mongoid 3 required ruby-1.9+
So can let me if the map/reduce wont work on criteria how to run the map/reduce then taking the other conditions in account i.e
active_performers.order_by([:sort_order,:desc])
Note: I just for clarity in haven't added the map and reduce function