bot-api/mongo-init.js

31 lines
524 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({ url: 1 }, { unique: true });
db.images.insert({
url: "https://example.com",
status: "consumed",
tags: ["2girls", "sleeping"],
});
db.authorizations.createIndex({ app: 1 });
db.authorizations.insert({
app: "tester",
secret: "test",
});