限制在PouchDB / CouchDB中同步的记录 [英] Limit records synchronized in PouchDB/CouchDB

查看:80
本文介绍了限制在PouchDB / CouchDB中同步的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要在线和离线工作的新闻库。我正在使用CouchDB(IBM Cloudant)和PouchDB使其与APP同步。

I have a news base that needs to work online and offline. I'm using CouchDB (IBM Cloudant ) and PouchDB to make this sync with the APP.

问题是新闻对于拥有照片和社交媒体来说相对繁重由于文档的大小而导致同步问题,并且看不到同步所有新闻库的任何需要,只会使用户的手机中充满不必要的记录。

The problem is that the news is relatively "heavy" for having photos and am having sync problems because the size of the "docs", and does not see any need to synchronize all the news base, will only fill the user's mobile phone with unnecessary records.

我只需要同步一些新闻,大约。五个寄存器。我想知道如何在CouchDB或PouchDB中做到这一点。

I need to sync only some news, approx. five registers. I wonder how can I do this in CouchDB or PouchDB.

我查看了同步+过滤器文档,但没有回答同步文档数量的问题(或

I looked in sync + filters documentation but does not answer me the question of the amount of sync docs (or at least did not see if it is possible).

我正在使用一个视图来提取新闻。

I'm using a view to pull the news.

推荐答案

是的,可以为此使用过滤复制: https ://pouchdb.com/api.html#filtered-replication

Yes you can, use filtered replication for this: https://pouchdb.com/api.html#filtered-replication

信用:Nolan Lawson(PouchDB核心团队)。

Credits: Nolan Lawson (PouchDB core team).

这篇关于限制在PouchDB / CouchDB中同步的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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