mongoist
mongoist copied to clipboard
Update MongoDB driver to 4.8.0
This PR updates MongoDB from 3.3.2
to 4.8.0
. This is an initiative toward adds types to this project.
References
- Driver & MongoDB compatibility table
- Mongo Driver 3.6 API
- Mongo Driver 4.8 API
- Updating Mongo Driver from 3.x to 4.x
Breaking Changes
MongoDB version
According to the compatibility table, current version 3.3.2
is compatible with MongoDB 2.6, 3, 3.2, 3.4, 3.6, 4, and 4.2.
Driver 4.8.0
is compatible with MongoDB 3.6, 4, 4.2, 4.4, 5, and 6.
Expand to see the compatibility table
Remove collection.group()
The same functionality can be achieved using the aggregation pipeline's $group operator.
Db name in the connection string
On this PR, dbName is not inferred from the connection string. Use the dbName option.
Old:
mongoist('localhost:27017/test')
New:
mongoist('localhost:27017', { 'dbName': 'test' })
Major changes
- collection.count now uses countDocuments instead of cursor.count.
- collection.mapReduce is deprecated. Kept for compatibility.
- collection.update and collection.remove returns additional info. "n" and "ok" are deprecated.
- cursor.count is deprecated. Kept for compatibility.
Hey @bradvogel, can you approve the PR's workflow?
Maybe we close this in favor of https://github.com/mongoist/mongoist/pull/97 and future work we will do in order to get support of MongoDB 6.0
Hi! I'm waiting for this upgrade to use compressors
option from MongoClient
is there any way I can help?