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

fix: fix compatibility issue with MongoDB 4.X #1180

Merged
merged 6 commits into from
Oct 12, 2021
Merged

fix: fix compatibility issue with MongoDB 4.X #1180

merged 6 commits into from
Oct 12, 2021

Conversation

rawb1
Copy link
Contributor

@rawb1 rawb1 commented Oct 11, 2021

Could be a good idea to bump mongo version ? I did not find any information on mongo version compatibility ...

Fixes #1174

@changeset-bot
Copy link

changeset-bot bot commented Oct 11, 2021

🦋 Changeset detected

Latest commit: acc94fe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@accounts/mongo-password Patch
@accounts/mongo-sessions Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rawb1 rawb1 changed the title Fix/insert one use new mongo node driver api fix: insert one use new mongo node driver api Oct 11, 2021
@codecov
Copy link

codecov bot commented Oct 11, 2021

Codecov Report

Merging #1180 (acc94fe) into master (926b421) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1180   +/-   ##
=======================================
  Coverage   95.40%   95.40%           
=======================================
  Files         106      106           
  Lines        2351     2351           
  Branches      461      463    +2     
=======================================
  Hits         2243     2243           
  Misses        105      105           
  Partials        3        3           
Impacted Files Coverage Δ
...ages/database-mongo-password/src/mongo-password.ts 100.00% <100.00%> (ø)
...ages/database-mongo-sessions/src/mongo-sessions.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 926b421...acc94fe. Read the comment docs.

@pradel
Copy link
Member

pradel commented Oct 11, 2021

@rawb1 thanks for the fix! Instead of bumping mongo what do you think of keeping the old behavior, if the ops property is set and then fallback to your fix if not. That way we would support old and new versions and will not force our users to upgrade to the latest mongo.

@rawb1
Copy link
Contributor Author

rawb1 commented Oct 11, 2021

@pradel I think it is a great idea, I will update the PR tomorrow !

@rawb1
Copy link
Contributor Author

rawb1 commented Oct 12, 2021

@pradel I've done the changes but the other way around as it is easier to check if insertedId exist thant if ops[0]._id
Tell me if it is fine for you :)

I looked up the mongodb version the packages are using, I can look into doing the migration to v4 if you need !

@types/mongodb  ^3.6.20  →   ^4.0.6
mongodb          ^3.4.1  →   ^4.1.3

Btw great fan of the project, I used to be a big fan of meteor accounts package !

.changeset/lovely-days-tickle.md Outdated Show resolved Hide resolved
packages/database-mongo-password/src/mongo-password.ts Outdated Show resolved Hide resolved
packages/database-mongo-password/src/mongo-password.ts Outdated Show resolved Hide resolved
@pradel
Copy link
Member

pradel commented Oct 12, 2021

Migration to v4 would be amazing, we can release this one as a patch version and next pr in a separate minor version :)

@pradel pradel changed the title fix: insert one use new mongo node driver api fix: fix compatibility issue with MongoDB 4.X Oct 12, 2021
@pradel pradel merged commit 975ced7 into accounts-js:master Oct 12, 2021
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 this pull request may close these issues.

authentication error with using mongoose "^6.0.5" but works with mongoose "^5.12.13"
2 participants