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

Removing a single event by id is not possible. #4

Closed
AlexanderProd opened this issue Mar 11, 2019 · 4 comments · Fixed by #5
Closed

Removing a single event by id is not possible. #4

AlexanderProd opened this issue Mar 11, 2019 · 4 comments · Fixed by #5

Comments

@AlexanderProd
Copy link

I've been trying to delete a single event by providing an eventName as well as an id to scheduler.remove() but it doesn't remove anything and just results

{
    "n": 0,
    "ok": 1
}

I've used an ID returned by scheduler.list()

Also the usage of collection.remove with mongodb seems to be deprecated but I guess it should work anyways.

I'm using version 1.2.1

@darkterra
Copy link
Owner

Hey AlexanderProd !

I just tried to delete an event stored in DDB and I have not encountered any problem, my event is deleted correctly, of course the others remained intact.

I grant you, the documentation needs to be reviewed to be more explicit ;)

For the deletion to work on a document specifically, the scheduler.remove () method must be given the name of the event and the id _ (objectID and not a String as indicated in the documentation) _. Ex:

scheduler.remove('my-event', objectId('5a5dfd6c4879489ce958df0c'), null, (err) => {
  if (err) {
    throw err;
  }
});

The pull request that you propose is a good idea :)

@darkterra
Copy link
Owner

darkterra commented Mar 12, 2019

AlexanderProd,

I will deploy this fix in the next version (1.2.3).
Can you confirm that this is correct once the downloaded update on your project?

@AlexanderProd
Copy link
Author

Yeah the fix is working, I've already tried it on my project in development. Just waiting for the release to use it in production.

@darkterra
Copy link
Owner

Hey Alexander !

I made a big update!
Be careful, it breaks a lot of things, I advise you to watch the new doc to make the necessary adaptations :)

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

Successfully merging a pull request may close this issue.

2 participants