15 lines
284 B
JavaScript
15 lines
284 B
JavaScript
|
db = db.getSiblingDB('tavi'); // 选择 mydatabase
|
||
|
db.someCollection.insert({ initialized: true }); // 在 mydatabase 中插入一条数据
|
||
|
db.createUser(
|
||
|
{
|
||
|
user: "test",
|
||
|
pwd: "test",
|
||
|
roles: [
|
||
|
{
|
||
|
role: "readWrite",
|
||
|
db: "tavi"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
);
|