Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to change the namespace of an entity (NDB)

I'm wondering if it would be a simple way of implementing a "Trash Can" in datastore..


Sorry, my passing thought was that if it was an easy thing to change the namespace of an entity then you could have a namespace such as "deleted" which would hide entities from the main namespace but keep them easily restorable. I couldn't find anything in the docs but thought I'd put the question out there just in case..
like image 473
lecstor Avatar asked Sep 11 '25 09:09

lecstor


1 Answers

Namespace is part of the entity key, which can not be changed once entity is created. The only way is to create new entity, copy properties and delete the original.

like image 197
Peter Knego Avatar answered Sep 14 '25 06:09

Peter Knego