MongoDB 集合意外删除/删除 [英] MongoDB Collections Unexpected Deletion/Drop

查看:50
本文介绍了MongoDB 集合意外删除/删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在 MongoDB 中的集合被自动删除/删除,我们不确定原因和方式.我们的 MongoDB 现在已经正常运行了将近 10 个月,所以我们真的不确定这里发生了什么.

Our collections in MongoDB were automatically deleted/drop and we are not sure why and how. Our MongoDB is working fine for almost 10 months now, so we are really not sure what happened here.

MongoDB 是否存在集合过期,它会自动删除集合及其数据?另外,是否可以检索数据?

Is there a collection expiration for MongoDB where it automatically delete the collections and its data? Also, would it be possible to retrieve the data?

先谢谢你!

推荐答案

集合不会自行丢弃".
有人在某处有意或无意地运行了 db.collection.drop().

Collections do not 'drop' themselves.
Someone has run db.collection.drop() somewhere, intentionally, or accidentally.

您可以为集合内的数据设置 TTL - 见这里 但是我不认为这就是这里发生的事情.

You can set a TTL on the data inside a collection - see here however I don't think that's what has happened here.

检索数据的唯一方法是从备份中.

The only way of retrieving the data would be from a backup.

将备份恢复到辅助数据库并复制有问题的集合,然后将其重新导入主数据库可能是这里的最佳方法.
...你确实有备份,对吗?

Restoring a backup to a secondary database and taking a copy of the collection in question, then importing that back into your main database may be the best approach here.
... You do have backups, right?

这篇关于MongoDB 集合意外删除/删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆