Skip to content

ADD: removeMany case to _run function (internal) #7

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,11 @@ var MongodbDriver = Base.extend({
else
db.collection(collection).insertOne(options, {}, callbackFunction);
break;
case 'removeMany':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be called deleteMany. Makes more sense, no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for helping on the review :)

The other case is named remove, @marc0der probably oriented after that, so wouldn't be an issue. This is an internal method anyway, but I agree that the mongodb needs some love. If you would be willing to give it a shot you're as always more than welcome to so :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly as @wzrdtales says.

@wzrdtales would you hit that merge button please :-) It's been open since 1 September 2017.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marc0der Nope. There are no tests, if you want you can create a fork from his tree and add them and put this into a new PR and I will he happy to merge :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the altering of remove needs to be removed as this would be a breaking change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that is why I told to fork :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry about it, I've already opted for using a different migration framework.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is totally ok, I always appreciate people contributing to open source though :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As do I, in fact I was using your open source project in my own open source project ;-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't a critique though, I'm totally fine if anyone uses something else instead. Open Source means freedom, but shouldn't be considered to be "for free". Everyone and every comany should contribute back, unfortunately many do not. I ment actually this specific PR of @meengit here which I do highly appreciate and I just mentioned it b/c this has been open for a really long time, which I'm sorry for. And the same reason why this has been lying around is which makes me appreciate people that help. I do not have unlimited time, so everyone that contributes is a tremendous help. And that is quite true for every open source project that is not backed by money or a company :)

db.collection(collection).deleteMany(options, callbackFunction);
break;
case 'remove':
// options is the records to insert in this case
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing and altetering functionality outside a deprication cycle is not allowed, therefore adding a new method is fine, but removing this is not allowed

if(util.isArray(options))
db.collection(collection).deleteMany(options, callbackFunction);
else
db.collection(collection).deleteOne(options, callbackFunction);
db.collection(collection).deleteOne(options, callbackFunction);
break;
case 'collections':
db.collections(callbackFunction);
Expand Down