fix counter eval
This commit is contained in:
parent
69ef8fa747
commit
aa8523c8cf
|
@ -7,7 +7,7 @@ module OrbitApp
|
||||||
map = "function(){ emit( this.referrer,{session_hash: this.session_hash,created_at: this.created_at}); };"
|
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};};"
|
reduce = "function(key, values){ var sum = 0; values.forEach(function(doc){sum += doc.amount; }); return {amount: sum};};"
|
||||||
if options.blank?
|
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
|
else
|
||||||
query = Impression.where(options).selector
|
query = Impression.where(options).selector
|
||||||
impressions = Impression.where(options).collection.map_reduce(map, reduce,read: :primary, out: "vr",:query=>query)
|
impressions = Impression.where(options).collection.map_reduce(map, reduce,read: :primary, out: "vr",:query=>query)
|
||||||
|
|
Loading…
Reference in New Issue