bot-api/mongo-init.js

24 lines
474 B
JavaScript
Raw Normal View History

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({ "image": 1 }, { "unique": true });
db.images.insert({
url: "https://example.com",
status: "consumed",
tags: ["2girls", "sleeping"]
});