guestbooky/build/mongodb/mongo-init.js

18 lines
323 B
JavaScript
Raw Permalink Normal View History

2024-10-05 00:27:04 +02:00
db = db.getSiblingDB('Guestbooky');
db.createUser(
{
user: "guestbookyuser",
pwd: "guestbookypassword",
roles: [
{
role: "readWrite",
db: "Guestbooky"
}
]
}
);
db.createCollection("GuestbookMessages");
db.GuestbookMessages.createIndex({ "Timestamp": 1 });