mirror of
https://github.com/appy-one/acebase.git
synced 2026-05-25 06:02:14 -06:00
[GH-ISSUE #96] Index on {key} not updated on insertion/deletion #57
Labels
No labels
IndexedDB
browser
bug
dependencies
documentation
duplicate
enhancement
feature request
indexes
indexes
invalid
pull-request
query
question
transaction logging
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/acebase#57
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @appy-one on GitHub (Apr 29, 2022).
Original GitHub issue: https://github.com/appy-one/acebase/issues/96
Originally assigned to: @appy-one on GitHub.
Discussion #92 led to the discovery of this issue: an index on the special key
{key}correctly indexes all current data upon creation, but is not updated on records being inserted or deleted, because it doesn't recognize it as a special key name.Example:
This does not happen with keys of actual properties in the data. An index on key
textwould be updated in above example.Background info: Using
{key}in an index is useful if you have nested collections and want to lookup one or more items in such nested collection. For example, if you want to lookup where the post with keyl2ksg00p000009lk8gdlh60hresides if there is a nested posts collection for each user:users/l2kshwwg000109lk0y45d25j/posts/l2ksg00p000009lk8gdlh60hwhen indexed withdb.indexes.create('users/*/posts', '{key}')and queried with.filter('{key}', '==', 'l2ksg00p000009lk8gdlh60h')@appy-one commented on GitHub (May 9, 2022):
This issue has been fixed in v1.18.0