Skip to content

Commit cf481c2

Browse files
Peter HuangAaronontheweb
andauthored
Added tags with ordering index (#318)
Co-authored-by: Aaron Stannard <[email protected]>
1 parent 30f30f7 commit cf481c2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Akka.Persistence.MongoDb/Journal/MongoDbJournal.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ protected override void PreStart()
9797

9898
collection.Indexes
9999
.CreateOne(modelWithOrdering);
100+
101+
var tagsWithOrdering = new CreateIndexModel<JournalEntry>(
102+
Builders<JournalEntry>
103+
.IndexKeys
104+
.Ascending(entry => entry.Tags)
105+
.Ascending(entry => entry.Ordering));
106+
107+
collection.Indexes
108+
.CreateOne(tagsWithOrdering);
100109
}
101110

102111
return collection;

0 commit comments

Comments
 (0)