Support for Aggregate Queries (#4207)
* Support for Aggregate Queries * improve pg and coverage * Mongo 3.4 aggregates and tests * replace _id with objectId * improve tests for objectId * project with group query * typo
This commit is contained in:
committed by
Florent Vilmart
parent
4e207d32a7
commit
7223add446
@@ -785,6 +785,8 @@ DatabaseController.prototype.find = function(className, query, {
|
||||
count,
|
||||
keys,
|
||||
op,
|
||||
distinct,
|
||||
pipeline,
|
||||
readPreference
|
||||
} = {}) {
|
||||
const isMaster = acl === undefined;
|
||||
@@ -853,6 +855,18 @@ DatabaseController.prototype.find = function(className, query, {
|
||||
} else {
|
||||
return this.adapter.count(className, schema, query, readPreference);
|
||||
}
|
||||
} else if (distinct) {
|
||||
if (!classExists) {
|
||||
return [];
|
||||
} else {
|
||||
return this.adapter.distinct(className, schema, query, distinct);
|
||||
}
|
||||
} else if (pipeline) {
|
||||
if (!classExists) {
|
||||
return [];
|
||||
} else {
|
||||
return this.adapter.aggregate(className, pipeline, readPreference);
|
||||
}
|
||||
} else {
|
||||
if (!classExists) {
|
||||
return [];
|
||||
|
||||
Reference in New Issue
Block a user