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

Upgrade mongodb to v3 #153

Merged
merged 1 commit into from
Apr 6, 2018
Merged

Upgrade mongodb to v3 #153

merged 1 commit into from
Apr 6, 2018

Conversation

stevenschobert
Copy link
Contributor

This doesn't have any breaking API changes, however the mongo upgrade is a major version bump, so that could cause some indirect breaking changes.

Changes

→ MongoDB Release Notes

Notably, the connection strings must not be URL encoded:

Following changes to the MongoDB connection string specification, authentication and hostname details in connection strings must now be URL-encoded. These changes reduce ambiguity in connection strings.

For example, whereas before mongodb://u$ername:pa$$w{}rd@/tmp/mongodb-27017.sock/test would have been a valid connection string (with username u$ername, password pa$$w{}rd, host /tmp/mongodb-27017.sock and auth database test), the connection string for those details would now have to be provided to MongoClient as mongodb://u%24ername:pa%24%24w%7B%7Drd@%2Ftmp%2Fmongodb-27017.sock/test.

There is also a small edge case the if you are using the find() method on a collection, you'll need to specify the type at the calling site:

// before
Model.getCollection()
  .find({ _id: 'someid' })
  .limit(1)
  .next();

// after
Model.getCollection()
  .find<any>({ _id: 'someid' })
  .limit(1)
  .next();

this doesn't have any breaking API changes, however the mongodb
upgrade is a major version bump, so that could cause some
inderect breaking changes
@etsuo
Copy link
Member

etsuo commented Apr 6, 2018

related to: #112

@etsuo etsuo merged commit 717f95d into sakuraapi:develop Apr 6, 2018
@stevenschobert stevenschobert deleted the mongo-upgrade branch April 6, 2018 19:29
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.

2 participants