diff --git a/lib/orbit_app/module/visitor_counter_eval.rb b/lib/orbit_app/module/visitor_counter_eval.rb index 9d1e30584..373bc84e5 100644 --- a/lib/orbit_app/module/visitor_counter_eval.rb +++ b/lib/orbit_app/module/visitor_counter_eval.rb @@ -7,7 +7,7 @@ module OrbitApp map = "function(){ emit( this.referrer,{session_hash: this.session_hash,created_at: this.created_at}); };" reduce = "function(key, values){ var sum = 0; values.forEach(function(doc){sum += doc.amount; }); return {amount: sum};};" if options.blank? - impressions = Impression.count #collection.map_reduce(map, reduce,read: :primary, out: "vr") + impressions = Impression.collection.map_reduce(map, reduce,read: :primary, out: "vr") else query = Impression.where(options).selector impressions = Impression.where(options).collection.map_reduce(map, reduce,read: :primary, out: "vr",:query=>query)