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
Add groupingKey option, to be able to store multiple trees in one collection #8
Conversation
@rubenstolk Thanks for the PR. It looks like a good feature to have. Can you please add some tests and document how to use this feature in the README file? |
@dambalah Done. |
@dambalah Also bumped the version to 0.0.6, would be nice if you can publish to NPM |
@rubenstolk The tests you've added look great but it looks like we are no longer testing the plugin in case somebody does not use a groupingKey. Could you please make sure we are still covering that path? Thank you! |
Does this help now? |
@rubenstolk Great. Thanks! |
Add groupingKey option, to be able to store multiple trees in one collection
@rubenstolk published on npm https://www.npmjs.org/package/mongoose-nested-set |
Great, thanks! Ruben Stolk CHANGER, Raising the bar in Online Experience! +91 95 6105 0034 INDIA OFFICE NETHERLANDS OFFICE On Sun, Nov 23, 2014 at 11:18 PM, Luc Castera notifications@github.com
|
One more remark, the node version is set to < 0.7.x in package.json, AFAIK Ruben Stolk CHANGER, Raising the bar in Online Experience! +91 95 6105 0034 INDIA OFFICE NETHERLANDS OFFICE On Sun, Nov 23, 2014 at 11:22 PM, Ruben Stolk | Changer <
|
And, we got it to work also with mongoose 3.x, any reason why you've set it Ruben Stolk CHANGER, Raising the bar in Online Experience! +91 95 6105 0034 INDIA OFFICE NETHERLANDS OFFICE On Sun, Nov 23, 2014 at 11:27 PM, Ruben Stolk | Changer <
|
Thanks: updated package.json for the node version eeaa990 |
Currently, it's not possible to have multiple trees in one collection. This PR makes that easily possible by specifying a
groupingKey
as option.In case of for example multi tenancy and you specify a property
tenant
on your model that is used for nested sets, simply setgroupingKey
totenant
and the update queries now make sure that only the matching elements get updated.