목록DataBase/MongoDB (3)
일상 코딩
https://docs.mongodb.com/v4.4/tutorial/install-mongodb-on-ubuntu/ Install MongoDB Community Edition on Ubuntu — MongoDB Manual Docs Home → MongoDB ManualMongoDB AtlasMongoDB Atlas is a hosted MongoDB service option in the cloud which requires no installation overhead and offers a free tier to get started.Use this tutorial to install MongoDB 4.4 Community Edition on LTS (long-ter docs.mongodb.com
2.1 연결하기¶ In [ ]: import pymongo In [ ]: host_info2 = 'mongodb://ubuntu:1234@127.0.0.1:27017' conn = pymongo.MongoClient(host_info2) print(conn) MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True) 2.2 mydbs Database 사용하기¶ In [ ]: # 몽고db 객체 생성 knowledge = conn.mydbs In [ ]: # 이렇게도 가능하다. knowledge = conn["mydbs"] In [ ]: print(dir(knowledge)) [&..
https://docs.mongodb.com/mongodb-shell/run-commands/ mongosh Usage — MongoDB Shell Docs Home → MongoDB ShellTo run commands in mongosh, you must first connect to a MongoDB deployment.To display the database you are using, type db:The operation should return test, which is the default database.To switch databases, issue the use helper, docs.mongodb.com