Skip to content

Commit

Permalink
Merge 204772a into e4a3f79
Browse files Browse the repository at this point in the history
  • Loading branch information
wmurphyrd committed Aug 11, 2022
2 parents e4a3f79 + 204772a commit 53ec3a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,7 @@

# Added

* New index on `streams.object.id` to cover Update on embedded objects (expect a one-time slow startup to build the index)
* getCollection gains optional `query` argument which is passsed
through to store.getStream to allow additional filtering or
aggregation to be applied
Expand Down
7 changes: 6 additions & 1 deletion store/index.js
Expand Up @@ -71,14 +71,19 @@ class ApexStore extends IApexStore {
}, {
name: 'collections'
})
// updates of objects embedded in streams
await db.collection('streams').createIndex({
'object.id': 1
}, {
name: 'stream-object-updates'
})
// object lookup
await db.collection('objects')
.createIndex({ id: 1 }, { unique: true, name: 'objects-primary' })
await db.collection('deliveryQueue')
.createIndex({ after: 1, _id: 1 }, { name: 'delivery-dequeue' })
await db.collection('objects')
.createIndex({ id: 1, type: 1 }, { name: 'local-user-count', partialFilterExpression: localUserQuery })
// TODO: index stream.object.id for updates
// also need partial index on stream.object.object.id for object updates when
// type is 'announce', 'like', 'add', 'reject' (denormalized collection types)
if (initialUser) {
Expand Down

0 comments on commit 53ec3a8

Please sign in to comment.