24 lines
472 B
JavaScript
24 lines
472 B
JavaScript
db.createUser({
|
|
user: 'root',
|
|
pwd: 'password',
|
|
roles: [
|
|
{
|
|
role: 'readWrite',
|
|
db: 'admin',
|
|
},
|
|
{
|
|
role: 'readWrite',
|
|
db: 'bot',
|
|
},
|
|
],
|
|
});
|
|
|
|
db = new Mongo().getDB("bot");
|
|
|
|
db.images.createIndex({ "status": 1 });
|
|
db.images.createIndex({ "url": 1 }, { "unique": true });
|
|
db.images.insert({
|
|
url: "https://example.com",
|
|
status: "consumed",
|
|
tags: ["2girls", "sleeping"]
|
|
}); |