Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selection not working on one to many on the one side. #25

Closed
shamasis opened this issue Dec 21, 2015 · 3 comments
Closed

selection not working on one to many on the one side. #25

shamasis opened this issue Dec 21, 2015 · 3 comments

Comments

@shamasis
Copy link
Member

No description provided.

@shamasis
Copy link
Member Author

Refers to .populate(assoc, {select: []})

@shamasis
Copy link
Member Author

@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.

@shamasis
Copy link
Member Author

@mikermcneil - had to fork wl-sequel. Is this change worth pushing to original wl-sequel?
postmanlabs/waterline-sequel@ce23238

Closing it since #28 fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant