由于某些原因,在我的应用上创建的文档未显示在我的远程couchdb
数据库中。
我正在使用以下
import PouchDB from 'pouchdb-react-native'
let company_id = await AsyncStorage.getItem('company_id');
let device_db = new PouchDB(company_id, {auto_compaction: true});
let remote_db = new PouchDB('https://'+API_KEY+'@'+SERVER+'/'+company_id, {ajax: {timeout: 180000}});
device_db.replicate.to(remote_db).then((resp) => {
console.log(JSON.stringify(resp));
console.log("Device to Remote Server - Success");
return resp;
}, (error) => {
console.log("Device to Remote Server - Error");
return false;
});
我得到了回复的成功回复:
{
"ok":true,
"start_time":"2018-05-17T15:19:05.179Z",
"docs_read":0,
"docs_written":0,
"doc_write_failures":0,
"errors":[
],
"last_seq":355,
"status":"complete",
"end_time":"2018-05-17T15:19:05.555Z"
}
当我转到我的远程数据库时,无法显示能够搜索和抓取应用程序的document_id。
注意:当我执行.from()
并从远程设备获取数据时,我会获取数据。出于某种原因,它只是没有推出数据
答案 0 :(得分:0)
"我能做些什么来检查为什么会发生这种情况?"
我会按照概述here尝试启用调试。
PouchDB.debug.enable('*');
这应该允许您在浏览器的JavaScript控制台中查看调试消息。