Support for nested .select() calls (#2737)

* Reproduction for #1567

* Recursive handling of nested pointer keys in select

* Better support for multi-level nested keys

* Adds support for selecting columns natively (mongo)

* Support for postgres column selections

* Filter-out empty keys for pg
This commit is contained in:
Florent Vilmart
2016-09-24 13:43:49 -04:00
committed by GitHub
parent 4974dbea37
commit 9c522be00d
7 changed files with 133 additions and 29 deletions

View File

@@ -711,6 +711,7 @@ DatabaseController.prototype.find = function(className, query, {
acl,
sort = {},
count,
keys
} = {}) {
let isMaster = acl === undefined;
let aclGroup = acl || [];
@@ -779,7 +780,7 @@ DatabaseController.prototype.find = function(className, query, {
if (!classExists) {
return [];
} else {
return this.adapter.find(className, schema, query, { skip, limit, sort })
return this.adapter.find(className, schema, query, { skip, limit, sort, keys })
.then(objects => objects.map(object => {
object = untransformObjectACL(object);
return filterSensitiveData(isMaster, aclGroup, className, object)