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
Future of findOrCreateEach and dynamic finders #5546
Comments
The way I see it is that |
I don't care if we strip If we do remove |
Also, familiarize yourself with what TLDR: 1st argument is an array of attributes to |
Also on that note, I am halfway-through implementing a For that I also followed the current way and implemented a Also does someone have a list of what all the dynamic finders are? |
helper methods:
Based on your Collection attributes you also have dynamic finders. So given a
Taken from https://github.com/balderdashy/waterline#query-methods |
How about moving dynamic finders to a separate (and optional) module/project? That way people who want to use them can use them and waterline core would have a tighter API. |
I actually just had the same thought - having it as a simple |
That's a great idea. I do like the simple |
Perform a survey by scanning github projects that have waterline as a It's pointless to make a change if those features are used by a majority of
|
This should then also be used to simplify things. There are for example two Anyone here knows more about this behaviour and the reasoning for both functions? |
I don't know if there are any peculiarities around these particular methods. But generally speaking, here's how it works: Methods in |
The main reason I am mentioning it is because to begin with it was quite hard to get into what is actually happening since the functions themselves look very similar and well - they look very similar. So there is a lot of almost duplicate code. Similar checks being done, both have call I am not sure if one of the two functions could be removed somehow but from the sounds of it you need both. And then I just wonder if they could use both call the same private functions for the overlapping stuff, or maybe only one of the functions actually needs to do the checks, etc. This is where I am going with it. What are your thoughts? |
I added a feature that lets you set |
@tjwebb From what I can see this would not disable |
I like findAndModify with option flags, its so extendable and battle tested... also the mongo db guys did a good job in documenting many use-cases of it.
My two cents :) |
Regarding
|
@dmarcelino I agree with the comment - I have also been thinking a bit more about the whole Maybe it would make sense to minimize the public API by adding options to the In my opinion both options have pros and cons - less functions means the public API is less cluttered but on the other hand having more options makes each command slightly more complicated. But either way the code would definitely benefit from cleaning up/refactoring. |
Thanks for posting, @dmarcelino. I'm a repo bot-- nice to meet you! It has been 60 days since there have been any updates or new comments on this page. If this issue has been resolved, feel free to disregard the rest of this message. On the other hand, if you are still waiting on a patch, please:
Thanks so much for your help! |
According to PR #843
findOrCreateEach
is deprecated:@tjwebb
@particlebanana:
The questions are:
findOrCreateEach
from waterline on0.11
?0.11
?cc @devinivy, @randallmeeker, @Globegitter, @RWOverdijk
The text was updated successfully, but these errors were encountered: