Closed shamasis closed 8 years ago
@mikermcneil - do you have a few minutes to spare on this problem I'm facing?
When doing sequel.find
with the following instructions, the select
is not honoured for the user
instruction.
{ where: null,
select: [ 'id', 'user', 'requests' ],
instructions:
{ user:
{ strategy: { strategy: 1, meta: { parentFK: 'user' } },
instructions:
[ { parent: 'groups',
parentKey: 'user',
child: 'user',
childKey: 'id',
select: [ 'id' ],
reducedSelection: true,
alias: 'user',
removeParentKey: true,
model: true,
collection: false,
criteria: { where: {}, select: [ 'id' ] } } ] } } }
I wanted to avoid peeking into WLSequel and hence, trying to see if this can be addressed from outside. The above instruction is a result from .populate
of a one-to-many association of group
and user
. The select
you see is being pushed by our variant of .populate
in deferred.js
.
@mikermcneil - had to fork wl-sequel. Is this change worth pushing to original wl-sequel? https://github.com/postmanlabs/waterline-sequel/commit/ce232382c803f1dacead0cc0bb796019dc59e25e
Closing it since #28 fixes it.
Refers to .populate(assoc, {select: []})