kuzzle
kuzzle copied to clipboard
As an end user, I'd like to identify documents with urn
Uniform Resource Name is a way to identify a resource through a system. Actually a document is identified by his ID but also by the index and collection. With URN we could share just one string to identify a precise document
These URN should be encoded like URL and the delimiter has to be defined. It will be very convenient to choose a delimiter which is encoded in query string (browser nav bar) to use existent libraries. The URN has to be encoded because the delimiter can be present inside document IDS since every characters are allowed inside IDS.
Then users should be able to send query with URN instead of index, collection & ID:
{
controller: 'document',
action: 'get',
urn: 'kuzzle.io%nyc-open-data%yellow-taxi%JkkzjSii87S'
}
Kuzzle should reject request with {{urn}} and either {{index}}, {{collection}} or {{_id}} to avoid conflicts.
Also, Kuzzle should return the URN inside documents alongside the ID and the body:
{
_id: 'JkkzjSii87S',
_urn: 'kuzzle.io%nyc-open-data%yellow-taxi%JkkzjSii87S',
_source: { ... },
}
https://trello.com/c/aUuXzvnm/246-adm-forbid-in-document-ids-to-allow-urn-format