裝mongoDB時要選costum,然後不要裝compass會卡住 裝好之後,要去TMDB註冊你的API key才可以做請求
在6.0之後的mongoDB,要使用mongosh才可以在終端機執行mongoDB相關操作,因為官方取代掉了舊的mongoDB executable。
裝好mongosh之後使用的指令
show dbs
: Show the list of databases.use <database-name>
: Select a database.show collections
: Show the list of collections in the current database.db.<collection-name>.find()
: Query the specified collection.db.<collection-name>.insertOne({<document-object>})
: Insert a new document into the specified collection.db.<collection-name>.updateOne({<query-object>}, {$set: {<update-object>}})
: Update a document in the specified collection.db.<collection-name>.deleteOne({<query-object>})
: Delete a document from the specified collection.