guestbooky/build/mongodb/mongo-init.js

18 lines
381 B
JavaScript
Raw Permalink Normal View History

db = db.getSiblingDB(process.env.GUESTBOOKY_DB_NAME);
2024-10-05 00:27:04 +02:00
db.createUser(
{
user: process.env.GUESTBOOKY_USER,
pwd: process.env.GUESTBOOKY_PASSWORD,
2024-10-05 00:27:04 +02:00
roles: [
{
role: "readWrite",
db: process.env.GUESTBOOKY_DB_NAME
2024-10-05 00:27:04 +02:00
}
]
}
);
db.createCollection("GuestbookMessages");
db.GuestbookMessages.createIndex({ "Timestamp": 1 });