Kinto / kinto

A generic JSON document store with sharing and synchronisation capabilities.
http://docs.kinto-storage.org/
Other
4.32k stars 421 forks source link

Rename object id #903

Open leplatrem opened 7 years ago

leplatrem commented 7 years ago

Suggested by @n1k0

Example:

echo '{"data": {"id":"tutu"}}' | http PUT :8888/v1/buckets/test --auth user:pass

Rename object id specified in URI using the id from the body payload.

Todo:

Thoughts ?

glasserc commented 7 years ago

No strong feelings. How does this work with synchronization?

Natim commented 7 years ago

How does it works with tombstones?

leplatrem commented 7 years ago

From the client point of view, this would just look like as if the bucket/collection/record was deleted (eg. 404)

Natim commented 7 years ago

Ok so we recreate it with the same last_modified id, we recreate all the child objects with their ID and last_modified value, we recreate all the permissions and we add tombstones for all the recreated objects. Is that correct?

leplatrem commented 7 years ago

oh no, I would just do something like:

Natim commented 7 years ago

Ok then we should probably allow to rename only bucket / collections but not records because it will break the synchronization mecanism.

glasserc commented 7 years ago

Ah, right. I misread this and thought it was about renaming records. Renaming buckets and collections seems OK to me.