由于某些原因,在我的应用程序上创建的文档没有显示在我的远程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;
});
Run Code Online (Sandbox Code Playgroud)
我得到一个成功的回应:
{
"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"
}
Run Code Online (Sandbox Code Playgroud)
当我转到远程数据库时,不会显示可在应用程序上搜索和获取的document_id。
注意:当我.from()从远程设备获取数据时,我会获取数据。由于某种原因,它只是没有将数据推出
javascript couchdb pouchdb react-native pouchdb-adapter-localstorage