-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
Implement the populate methods from Mongoose. #137
Comments
Sounds great! Thanks for breaking the change up into smaller parts. It makes it much easier to review and merge. |
#137 - Enhancement/implementing populate
This will be a great addition to dynamoose. What's the status on populate, if you'd like help, I'd love to try and implement. Thanks for the work! |
Yay, glad you like the proposal @chops318 ! 😁 Go for it buddy, I'm kindda stuck with a lot of work to be done and I might take longer than expected to finish this feature, so, help is always welcome!! =D |
Would this eliminate the need for nested queries, e.g.: Product.get(id, (err, product) => {
if (!product) { /* no product found */ }
else {
Category.get(id, (err, category) => {
if (!category) { /* no category found */ }
else {
product.category = category
}
})
}
}) /ref #120 (comment) |
@troyswanson Yeah yeah, definitely!! My goal is to make:
|
AHH! I love it! Thank you! |
That's my intention aswell. I'm pretty much going to model the API as close to mongoose as possible |
@chops318 Thanks for offering to help. I'm looking forward to your PR. |
@chops318 Do you know when you plan to have this PR ready. I'm planning to release 0.8 sometime over the next week. I would like to include this in that release if you think it will be ready. |
@brandongoode I will be done sometime this weekend. What do ya'll think about using the bson module to generate the ObjectIds? Seeing as that is what mongoose uses, I figure we would follow suit. |
I would prefer not to populate ObjectIds. With dynamoDB it really a hash/range key pair with the range optional. There may not even be an ID attribute. If someone wants to have keys auto-generated, they should use the |
I agree with you @brandongoode, but we'll still need the Such as |
@lucianopf Yes. |
@chops318 If there is anything I can do to help let me know. |
Is it possible to contribute to this feature? How can I do it? |
Hello guys, I'm back! hehehe After this AWS Reinvent, let's keep this rocking and release that!! @dimitribocquet and @brandongoode!! That's already partially implement at the master branch @dimitribocquet as stated here |
@lucianopf - great to hear from you. This is one of a few items i want to make sure is fully supported in the 0.9 release. |
Leave stuff to be done later screws the mind flow! hahaha It will be done! 💪 |
Enhancement/populate method - #137
I think the last step to get this done is to enhance the docs, right @brandongoode ? |
@lucianopf @brandongoode If I have some extra time over the next few weeks I plan on working on the documentation. Anyone maybe up for creating some issues about what should be added/improved (especially @lucianopf maybe since you said you kept having to check the demos and tests)? What specifically should I focus on if I get time? |
Nice @fishcharlie !! ❤️ open-source! |
@lucianopf Tag me in any issues you create so I get alerted to them. Thanks for your contributions as well!! Really looking forward to this feature. Will need some good documentation tho before I know how to use it haha. |
Hey buddy I haven't forgotten to do that, I'm just in a rush at my other projects and I wasn't able to point stuff for you to document yet =/ I'll try to do that during this weekend! ^^ @fishcharlie |
This can be closed via #250, correct? |
Closing this due to no recent activity. If this is still a problem or you have questions please feel free to comment again and we can try to help further. |
Thanks buddy, and I'm sorry for not replying! 😬 The documentation is way better than I actually thought hehehe |
Reason
Since this is heavily inspired at Mongoose I think we should also implement the populate methods inspired by them.
This is their ref: Official docs
Also that feature makes coding way faster without the need of implementing consecutive queries to get the full result.
Proposal
Since I'm a new contributor I don't understand every aspect of this library yet, so I'll purpose small and incremental changes until we have a very similar structure of mongoose's populate method.
By that I'll list goals here so we can keep track and if anyone else wants to get involved follow up the development.
Dog.get(1).populate('father')
Dog.get(1).populate('father.father')
The text was updated successfully, but these errors were encountered: