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

Add support for mongodb@5 #1547

Open
sebamarynissen opened this issue Aug 2, 2023 · 2 comments
Open

Add support for mongodb@5 #1547

sebamarynissen opened this issue Aug 2, 2023 · 2 comments

Comments

@sebamarynissen
Copy link

Hi there,

I've noticed that Agenda doesn't support mongodb@5 when creating an agenda instance like

import mongo from 'mongodb';

const client = new mongo.MongoClient(MONGO_URI);
await client.connect();
const agenda = new Agenda({
  mongo: client,
});
await agenda.start();

The reason for this is that agenda is still using callbacks in some locations, but mongodb has removed support for it. I was able to fix this and add support for mongodb@5 in a fork: sebamarynissen#1.

However, as I understand from #1503, there is currently an ongoing effort to move @hokify/agenda back into this repository, but it hasn't been released on npm yet. Therefore the master branch in this repository differs significantly from the version 5.0.0 that is available on npm, so I can't create a PR against the master branch.

Would it be possible to create a v5 branch in this repository based on 8f46df0 so that I can create a PR to merge my fork into it? It could then be released on npm as agenda@5.1.0 adding support for mongodb@5.

@simllll
Copy link
Contributor

simllll commented Aug 2, 2023

Not sure if it's worth the effort, you could use @hokify/agenda in the meantime (which includes a bunch of other fixes too), which would also make an easier transition to 6.0 (when released :))? :)

@sebamarynissen
Copy link
Author

@simllll Thanks for the suggestion, that's what I already did in my project to be able to migrate to mongodb@5. I just thought it would be useful to fix it in agenda@5 as well, as this could add support for mongodb@5 quickly. The fix wasn't that hard to implement in the v5 codebase.

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

No branches or pull requests

2 participants