mongodbHow to check the version of MongoDB?
To check the version of MongoDB, you can use the db.version()
command.
> db.version()
4.2.3
The command db.version()
returns the version of MongoDB that is currently running.
The parts of the code are:
db
: This is the database object that is used to access the database.version()
: This is the method that is used to get the version of MongoDB.
Helpful links
More of Mongodb
- How to use watch in MongoDB?
- How to update one document in MongoDB?
- How to select specific fields in MongoDB query?
- How to insert new document into MongoDB?
- How to kill an operation in MongoDB?
- How to use hint in MongoDB?
- How to sort MongoDB query results?
- How to implement pagination in MongoDB?
- How to set MongoDB oplog?
- How to rename a field in MongoDB?
See more codes...