More aggregation changes.

This commit is contained in:
Samuel Clay 2016-11-20 13:11:56 -08:00
parent 5dc079efc2
commit 56b3dfa659
4 changed files with 4 additions and 4 deletions

View file

@ -2621,7 +2621,7 @@ class MStarredStory(mongo.DynamicDocument):
},
}])
month_ago = datetime.datetime.now() - datetime.timedelta(days=days)
user_ids = stats['result']
user_ids = list(stats)
user_ids = sorted(user_ids, key=lambda x:x['stories'], reverse=True)
print " ---> Found %s users with more than %s starred stories" % (len(user_ids), stories)

View file

@ -1533,7 +1533,7 @@ class MSharedStory(mongo.DynamicDocument):
},
}])
month_ago = datetime.datetime.now() - datetime.timedelta(days=days)
user_ids = stats['result']
user_ids = list(stats)
user_ids = sorted(user_ids, key=lambda x:x['stories'], reverse=True)
print " ---> Found %s users with more than %s starred stories" % (len(user_ids), stories)

View file

@ -40,7 +40,7 @@ class NBMuninGraph(MuninGraph):
},
}])
return stats['result']
return list(stats)
if __name__ == '__main__':

View file

@ -43,7 +43,7 @@ class NBMuninGraph(MuninGraph):
},
}])
return stats['result'][0]
return list(stats)[0]
if __name__ == '__main__':