[英]Soft Delete Procedure in MongoDB
We are going to develop multi tenant based project, based on Java Spring Boot at backend and MongoDb as a database. 我们将基于后端的Java Spring Boot和作为数据库的MongoDb开发基于多租户的项目。
I want to ask that is there any procedure to make soft delete other than insert a attribute true/false or 0/1 ? 我想问问,除了插入属性true / false或0/1之外,还有什么程序可以进行软删除?
Thanks for the help... 谢谢您的帮助...
If you don't want to delete or use an attribute as a isDeleted
or similar name. 如果您不想删除属性或将属性用作
isDeleted
或类似名称。 You have to move deleted documents to another collection namely deletedCollections
and hard delete the current document from the current collection. 您必须将已删除的文档移动到另一个集合,即
deletedCollections
然后从当前集合中硬删除当前文档。 This methodology can be useful to manage these unwanted or deleted data for current collection. 此方法可用于管理这些不想要的或已删除的数据以进行当前收集。
This way is useful to reach the deleted or archived data in another time. 这种方法对于再次访问已删除或已归档的数据很有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.