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

mongodb driver 4.x support for Mongo Altas Serverless #638

Open
apocist opened this issue Aug 17, 2021 · 6 comments
Open

mongodb driver 4.x support for Mongo Altas Serverless #638

apocist opened this issue Aug 17, 2021 · 6 comments

Comments

@apocist
Copy link

apocist commented Aug 17, 2021

Suggestion

I suggest updating the dependency for MongoDB nodejs driver ^4.1.0

Use Cases

The latest MongoDB driver allow access to MongoDB Altas cloud infrastructure and loadBalanced databases. Connection to this atlas service is impossible with the 3.x series at this time.

Examples

https://github.com/mongodb/node-mongodb-native/blob/4.0/docs/CHANGES_4.0.0.md
https://github.com/mongodb/node-mongodb-native/releases/tag/v4.1.0

Acceptance criteria

TBD - will be filled by the team.

@dhmlau
Copy link
Member

dhmlau commented Aug 19, 2021

@apocist, thanks for your suggestion. Would you like to submit a PR?

@CNSKnight
Copy link

+1 add on a complete refactor of the ogre that is https://github.com/loopbackio/loopback-connector-mongodb
#mongoDBCloudIsHot

@apocist
Copy link
Author

apocist commented Aug 20, 2021

I've already actually made a working version for some projects at https://github.com/Sitetheory/loopback-connector-mongodb/tree/mongodb-driver-4.x that can be tested via npmjs with @sitetheory/loopback-connector-mongodb

full tests aren't complete and will break 3.x compatibility (due to driver changes), but I can make a PR now if wanted (can do so in morns)

@apocist apocist mentioned this issue Aug 20, 2021
5 tasks
@stale stale bot added the stale label Oct 19, 2021
@loopbackio loopbackio deleted a comment from stale bot Oct 19, 2021
@stale stale bot removed the stale label Oct 19, 2021
@arsa-dev
Copy link
Contributor

I've checked the version from @apocist and it is working properly as expected with mongodb driver 4.x, I also have checked PR #639 that has been closed by the stale bot.

Don't know the exact reason but since I don't know @apocist availability to reopen it I'm going to open a new one between today/tomorrow with his changes so we can continue discussion and implement anything required to make the official connector running with driver version 4.x, required as mentioned to use MongoDB Atlas connections and loadBalance option.

@apocist
Copy link
Author

apocist commented May 12, 2022

I've since stopped maintenance on the #639 changes as we've moved away from using Mongo Altas Serverless due to some limitations, but it's usages still seems effective with mongodb ^4.1.0

@arsa-dev
Copy link
Contributor

arsa-dev commented May 15, 2022

One day later than expected, but I've finally created promised pull request #672 with only one pending to check test, failing due to bson.ObjectId upgrade that cause object instances to be indetectable to lodash isEmpty function.

This generates a new unwanted behaviour on model relationships when filtering by only one resulting id property instance after intersect possible ids and where filter one(s). Since ObjectId instances are now indetectable to isEmpty function current loopback-datasource-juggler repo logic assumes that is not needed to send query to connector since at his eyes cannot be a result so immediately fire callback with empty result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Current/Backlog
Development

No branches or pull requests

4 participants