a few things I learn about mongodb
-
- we can have multiple versions of MongodDB installed on Mac. Follow the tutorial below:
https://www.mongodb.com/docs/v5.0/tutorial/install-mongodb-on-os-x/ - Switch version by
brew services stop mongodb-community@5.01
then start another one, for example: @6.0 - mongodrestore with drop will not create the indexes.
- mongodrestore without drop will not update the records with the same _id
- so maybe just delete the database and run mongodbrestore with drop? I do this LOCAL ONLY
- aggregation $firstN is a new feature for mongod5.3+, and only Mongod5.0 can be installed locally, other rapid version need MongoAtlas. https://www.mongodb.com/docs/manual/reference/operator/aggregation/firstN/
- if target db version is higher than source, mongorestore could fail.
- we can have multiple versions of MongodDB installed on Mac. Follow the tutorial below: