diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2014-05-14 15:35:51 +0200 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2014-05-14 15:35:51 +0200 |
commit | e7bb2f83f5f9650ef2584873cff95e9dc500b594 (patch) | |
tree | 87158bb0b186c0497c54ca259793009a5eb8e524 /app/handlers/base.py | |
parent | eac67ca29414a1738753730ce3453445355e3379 (diff) |
Implement $match mongodb on aggregation.
* Needed to match documents on provided values.
Diffstat (limited to 'app/handlers/base.py')
-rw-r--r-- | app/handlers/base.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/handlers/base.py b/app/handlers/base.py index 0feedbd..01326b7 100644 --- a/app/handlers/base.py +++ b/app/handlers/base.py @@ -313,7 +313,9 @@ class BaseHandler(RequestHandler): unique = self.get_query_argument('aggregate', default=None) if unique: self.log.info("Performing aggregation on %s", unique) - return aggregate(self.collection, unique, sort=sort, fields=fields) + return aggregate( + self.collection, unique, sort=sort, fields=fields, match=spec + ) else: return find_and_count( self.collection, @@ -382,7 +384,7 @@ class BaseHandler(RequestHandler): they values are based on the `sort_order` argument and defaults to the descending order. - :return A `spec` data structure. + :return A `sort` data structure. """ sort_fields = self.get_query_arguments('sort') sort_order = int( |