diff --git a/app/models/site_feed_annc.rb b/app/models/site_feed_annc.rb index 9626394..9952b79 100644 --- a/app/models/site_feed_annc.rb +++ b/app/models/site_feed_annc.rb @@ -353,7 +353,10 @@ class SiteFeedAnnc end pipeline_to_get_count = pipeline.clone - pipeline_to_get_count << {"$count" => "count"} + pipeline_to_get_count << {"$group" => { + _id: nil, + count: {"$sum" => 1} + }} count_result = SiteFeedAnncDetail.collection.aggregate(pipeline_to_get_count).first feeds_count = count_result ? count_result["count"] : 0