Skip to content

Commit

Permalink
fix: mediator unique constraint issue (#25)
Browse files Browse the repository at this point in the history
Signed-off-by: Shailesh Patil <[email protected]>

Signed-off-by: Shailesh Patil <[email protected]>
  • Loading branch information
mineme0110 committed May 1, 2024
1 parent 6fe228f commit c1f0230
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 c1f0230

Please sign in to comment.