Skip to content

[Learning Note] MongoDB

Gukie edited this page Nov 13, 2017 · 10 revisions

mongod 是一个数据交互的一个后台进程: mongod is the primary daemon process for the MongoDB system. It handles data requests, manages data access, and performs background management operations

mongos是一个分布式的路由服务: mongos for “MongoDB Shard,” is a routing service for MongoDB shard configurations that processes queries from the application layer, and determines the location of this data in the sharded cluster, in order to complete these operations


start mongodb: mongod --config /etc/mongod.conf


mongodb.exe -- 启动 mongodb mongo.exe -- connection to MongoDB


connect with Mongo Shell use following command to connect to cluster by replacing with your password:

mongo "mongodb://cluster0-shard-00-00-wpy0t.mongodb.net:27017,cluster0-shard-00-01-wpy0t.mongodb.net:27017,cluster0-shard-00-02-wpy0t.mongodb.net:27017/test?replicaSet=Cluster0-shard-0" --authenticationDatabase admin --ssl --username admin --password

refer: https://docs.atlas.mongodb.com/mongo-shell-connection/?_ga=2.43896805.1120728808.1510535298-1976534498.1510303448


MongoDB connection: mongodb://localhost:27017


MongoDB Compass - UI display


Spring boot integrate with MongoDB

refer: https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-data-mongodb

Clone this wiki locally