Use IndexablePresence for hasFileAttachments and hasVisualMediaAttachments

Reduces index size, makes it easier to debug using IndexedDB inspector, and
hopefully improves lookup performance.
This commit is contained in:
Daniel Gasienica 2018-04-25 14:15:06 -04:00
parent 3a33d862c0
commit f36f206a01
9 changed files with 32 additions and 24 deletions

View file

@ -30,8 +30,8 @@ export const fetchVisualMediaAttachments = async ({
collection.fetch({
index: {
name: 'hasVisualMediaAttachments',
lower: [conversationId, hasVisualMediaAttachments, lowerReceivedAt],
upper: [conversationId, hasVisualMediaAttachments, upperReceivedAt],
lower: [conversationId, lowerReceivedAt, hasVisualMediaAttachments],
upper: [conversationId, upperReceivedAt, hasVisualMediaAttachments],
order: 'desc',
},
limit: 50,