CouchDB上的'doc_del_count'比'doc_count'大 [英] 'doc_del_count' bigger than 'doc_count' on CouchDB

查看:139
本文介绍了CouchDB上的'doc_del_count'比'doc_count'大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚收到一个可与 CouchDB CouchBase Lite 一起使用的Android项目。

I have just received an Android project that works with CouchDB and CouchBase Lite.

应用程序的第一步是复制,复制或多或少地花费了超过2个小时,但通常从未完成。

The first step in the app is a replication, more or less the replication spent more than 2 hours, but usually it never finish.

在数据库站点上,我看到doc_del_count大于doc_count,这没有意义,因为我们从不删除文档。

On the dataBase site I can see that doc_del_count is bigger than doc_count, It does not make sense because we never delete documents.

在这种情况下,复制过程处理了519695个文档,其中的498264个被删除,因此很疯狂

In this case the replication process handles 519695 documents and 498264 of them are deleted, so it is crazy

我的问题是:< br>
如果已删除文档,为什么要复制下载 doc_del_count

如何查看那些已删除的文档?

我可以删除所有那些 doc_del_count 吗?

推荐答案


如果复制的doc_del_count是删除的文档,为什么要复制下载?

Why replication download doc_del_count if they are deleted documents?

因为在CouchDB中从未真正删除过删除的文档。而是将 _deleted 字段设置为 true 。这主要是为了允许适当的同步,其中更新可以在多个位置发生。想象一下,某个文档已从一个地方删除,但已更新为在另一个地方包含新信息。哪个操作应该优先? CouchDB没有办法知道,因此它保留了这两个版本,并让应用程序设计人员按他们认为合适的方式解决冲突。

Because deleted documents are never truly deleted in CouchDB. Instead, the _deleted field is set to true. This is primarily to allow proper synchronization where updates can happen in more than one place. Imagine that a document is deleted from one place, but updated to include new information in another. Which operation should take priority? CouchDB has no way of knowing, so it keeps both versions around, and lets the application designer handle conflict resolution as they see fit.


如何我可以看到那些删除的文档吗?

How Can I see those deleted documents?

咨询此答案以了解详细信息,但简短的答案是:在每个查询中,在revs_info = true //docs.couchdb.org/en/2.0.0/api/document/common.html rel = nofollow noreferrer>文档。

Consult this answer for details, but the short answer is: include revs_info=true in your query per the documentation.


我可以删除所有那些doc_del_count吗?

Can I removed all those doc_del_count? How?

您可以压缩数据库,但是由于上述原因,这不会删除已删除的文档。

You can compact the database, but this won't remove deleted documents, for reasons explained above.

这篇关于CouchDB上的'doc_del_count'比'doc_count'大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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