MongoDB ver 4 幾個經常使用命令

1. 爲某個數據庫建立用戶:數據庫

use db_test1;io

db.createUser({
user:"test_user_1",
pwd:"test_user_1_pwd",
roles:[{role:"dbOwner",db:"test_db_1"}]});test

 

2. 在某個數據庫中刪除用戶:
db.dropUser("notaboouser");數據

 

3. 建立一個集合,查看集合:top

db.createCollection("topic")db

show collectionstab

相關文章
相關標籤/搜索