I use pouchDB in my hybrid (Ionic) application to send and receive data from my Cloudant databases.
I have used continuous replication so far, but there are too many transactions, and the account on the server is growing!
Can you help me rewrite my code with “best practices” to avoid this?
Is this the best pratice for declaring a remote url, for example, or do I need a local copy of the database?
As you can see, I am new to pouchDB / couchDB and I do not understand how to properly manage replication.
Thanks for your help!
.factory('usersDatabase', [ 'pouchDB', function (pouchDB) { 'use strict'; var usersDatabase = pouchDB('boaine_users'), remote = 'https://ididi: pwdpwd@myaccount.cloudant.com /boaine_users', opts = { live: true, retry: true }; usersDatabase.replicate.to(remote, opts); usersDatabase.replicate.from(remote, opts); return usersDatabase; } ])
Louis source share