You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
When indexing message attachment metadata using numeric indexes such as: ```javascript { conversationId: '+12223334455', received_at: 123, attachments: […], numAttachments: 2, }, { conversationId: '+12223334455', received_at: 456, attachments: [], numAttachments: 0, } { conversationId: '+12223334455', received_at: 789, attachments: [], numAttachments: 1, } ``` It creates an index as follows: ``` [conversationId, received_at, numAttachments] ['+12223334455', 123, 2] ['+12223334455', 456, 0] ['+12223334455', 789, 1] ``` This means a query such as… ``` lowerBound: ['+12223334455', 0, 1 ] upperBound: ['+12223334455', Number.MAX_VALUE, Number.MAX_VALUE] ``` …will return all three original entries because they span the `received_at` from `0` through `Number.MAX_VALUE`. One workaround is to index booleans using `1 | undefined` where `1` is included in the index and `undefined` is not, but that way we lose the ability to query for the `false` value. Instead, we flip adjust the index to `[conversationId, hasAttachments, received_at]` and can then query messages with attachments using ``` [conversationId, 1 /* hasAttachments */, 0 /* received_at */] [conversationId, 1 /* hasAttachments */, Number.MAX_VALUE /* received_at */] ``` |
7 years ago | |
---|---|---|
.. | ||
app | 7 years ago | |
models | 7 years ago | |
modules | 7 years ago | |
styleguide | 7 years ago | |
views | 7 years ago | |
.eslintrc.js | 7 years ago | |
_test.js | 7 years ago | |
backup_test.js | 7 years ago | |
blanket_mocha.js | 11 years ago | |
conversation_controller_test.js | 7 years ago | |
crypto_test.js | 7 years ago | |
database_test.js | 7 years ago | |
emoji_util_test.js | 8 years ago | |
fixtures.js | 7 years ago | |
fixtures_test.js | 7 years ago | |
i18n_test.js | 7 years ago | |
index.html | 7 years ago | |
keychange_listener_test.js | 7 years ago | |
libphonenumber_util_test.js | 9 years ago | |
manual.txt | 8 years ago | |
reliable_trigger_test.js | 8 years ago | |
spellcheck_test.js | 8 years ago | |
storage_test.js | 7 years ago |