mirror of
https://github.com/jo/couchdb-best-practices.git
synced 2026-05-15 14:16:00 -06:00
[GH-ISSUE #75] one to N relations example #675
Labels
No labels
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/couchdb-best-practices#675
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 @horacimacias on GitHub (Apr 12, 2021).
Original GitHub issue: https://github.com/jo/couchdb-best-practices/issues/75
first of all thanks for these notes; there are very helpful.
Regarding the "one to N relations" example, I suggest making a minor update or adding some description of possible side effects.
In the example provided, where
artistis "embedded" in thealbumsids, between ":" separators, I'd suggest using this:instead of this (note there is no ":" after the value on
startkey)The current example would return albums for any artist whose name includes
tom-waits; e.g.tom-waitsonwhich is probably not what's intended.It may not be an extremely common scenario but since the artist is already put between ":" separators in the albums' ids, it may be a good idea to restrict
startkeyby that separator as well?@jo commented on GitHub (Apr 3, 2022):
fixed with
9a462524e0Thank you, @horacimacias