Fix aggregation pipeline match step

This commit is contained in:
Nikita Tokarchuk
2020-06-04 18:15:59 +02:00
parent eac50d1770
commit 3035d8d571
+1 -1
View File
@@ -111,7 +111,7 @@ func (d *Database) createAggregateLoad(target interface{}, composed *query.Query
pipeline := primitive.A{}
if !composed.Empty() {
pipeline = append(pipeline, primitive.M{"$match": primitive.M{"$expr": composed.M()}})
pipeline = append(pipeline, primitive.M{"$match": composed.M()})
}
if composed.Sorter() != nil {
pipeline = append(pipeline, primitive.M{"$sort": composed.Sorter()})