Skip to content

Commit

Permalink
fix: mediator unique constraint issue (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
mineme0110 authored Jun 29, 2023
1 parent 8a2a6ad commit 576d7a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion initdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ db.createCollection(collectionDidAccount);
db.createCollection(collectionMessages);
//create index
db.getCollection(collectionDidAccount).createIndex({ 'did': 1 }, { unique: true });
db.getCollection(collectionDidAccount).createIndex({ 'alias': 1 }, { unique: true });
// Only enforce uniqueness on non-empty arrays
db.getCollection(collectionDidAccount).createIndex({ 'alias': 1 }, { unique: true , partialFilterExpression: { "alias.0": { $exists: true } }});
db.getCollection(collectionDidAccount).createIndex({ "messagesRef.hash": 1, "messagesRef.recipient": 1 });

0 comments on commit 576d7a3

Please sign in to comment.