In continuation of my previous posts relating to a failure while replicating the remote CouchDB - I used the FruitDown Adapter:
My code is like:
PouchDB and Adapter referencing done on index.html as follows:
<script src="lib/pouchdb/pouchdb-5.1.0.min.js"></script>
<!-- FruitDown Adapter for iOS -->
<script src="lib/pouchdb/pouchdb.fruitdown.js"></script>
And a Factory that creates the Local & Remote data base references are as follows:
setLocalDb: function () {
local_db_name = 'local_db';
if (isIOS) {
local_db = new PouchDB (local_db_name, {adapter: 'fruitdown'});
} else {
local_db = new PouchDB (local_db_name);
}
}
setRemoteDb: function () {
remote_db_name = 'remote_db';
if (isIOS) {
remote_db = new PouchDB ('http://my_remote_address', {
auth: {username: 'admin', password: 'admin123'}, adapter: 'fruitdown'});
} else {
remote_db = new PouchDB ('http://my_remote_address, {
auth: {username: 'admin', password: 'admin123'}
});
}
}
With the above code - when I call a replicate()
method - the replication stops on the PAUSE block and Error shown as 'Error: Adapter is missing'
Could you please guide where am I going wrong ??
That error means that the pouchdb.fruitdown.js
was not included on the page somehow. Can you double-check that it was loaded by printing out PouchDB.preferredAdapters
or Object.keys(PouchDB.adapters)
? It should contain ['idb', 'websql', 'fruitdown']
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.