monorepo-microservice-rbac/init.mongo.js

15 lines
284 B
JavaScript
Raw Permalink Normal View History

2023-09-08 14:15:06 +08:00
db = db.getSiblingDB('tavi'); // 选择 mydatabase
db.someCollection.insert({ initialized: true }); // 在 mydatabase 中插入一条数据
db.createUser(
{
user: "test",
pwd: "test",
roles: [
{
role: "readWrite",
db: "tavi"
}
]
}
);