New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow to re-order items within a shelf #521
Comments
isnt an array already an ordered list, one can query with an index, reorder at will etc. ? |
@jum-s the array above is on a single item that is in several shelves, the ordinal then gives the place of that item within those different shelves. For instance, the 2 following items could be ordered within 3 different shelves like so: {
_id: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
entity: 'isbn:9782729897093',
shelves: [
{ id: '0a35e15bdff5c8c0507207898f00003c', ordinal: 1 },
{ id: 'a51ca773050dc882b8105b0d18000ecc', ordinal: 1 },
{ id: 'cce00081d0b5018b288cd050377ac15a', ordinal: 2 }
]
} {
_id: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
entity: 'isbn:9781941999738',
shelves: [
{ id: '0a35e15bdff5c8c0507207898f00003c', ordinal: 2 },
{ id: 'a51ca773050dc882b8105b0d18000ecc', ordinal: 2 },
{ id: 'cce00081d0b5018b288cd050377ac15a', ordinal: 1 }
]
} |
im a bit rusty, my bad |
the other question to me is : isnt it the client responsibility to sort items. Is it that necessary to store this information server-side ? Users may not that much appreciate to sort "for good" and just according to the current need/mood. |
I see 2 distinct features:
|
Also ties in to #315 |
Re-ordering items has been a recurring feature request.
This could be implemented by adding an ordinal to items' shelves array, from the current array of id:
to an array of objects:
This should allow to get the items of a given shelf already ordered directly from CouchDB
The text was updated successfully, but these errors were encountered: