Skip to content

Commit

Permalink
added the collection in init script
Browse files Browse the repository at this point in the history
  • Loading branch information
mineme0110 committed Jun 5, 2023
1 parent 1632f5f commit e6da9a2
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion initdb.js
Expand Up @@ -4,4 +4,17 @@ db.createUser({
roles: [
{ role: "readWrite", db: "mediator" }
]
})
});

const database = 'mediator';
const collectionDidAccount = 'did_account';
const collectionMessages = 'messages';

// The current database to use.
use(database);

// Create collections.
db.createCollection(collectionDidAccount);
db.createCollection(collectionMessages);
//create index
db.collectionDidAccount.createIndex({ 'alias': 1 }, { unique: true });

0 comments on commit e6da9a2

Please sign in to comment.