由于某种原因,在我的应用程序上创建的文档没有显示在我的远程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 不会出现。
- 有什么我没有考虑到的吗?
- 我可以做些什么来检查为什么会发生这种情况?
- 当我在 Ionic 中使用相同的脚本方法时,这很有效,当我切换到 React-Native 时,我注意到情况就是这样。
注意:当我.from()
从远程获取数据到设备时,我得到了数据。出于某种原因,它只是没有推出数据