Can't connect to remote DB
I have problem with connecting with remote DB. This is my code snippet:
import PouchDB from 'react-native-pouchdb';
PouchDB.plugin(require('pouchdb-adapter-asyncstorage').default);
const usrs = new PouchDB('http://127.0.0.1:3000/proba');
usrs.info().then(function (result) {
console.log("info: ", result);
}).catch(function (err) {
console.log(err);
});
I have this error: CustomPouchError {status: 400, name: "bad_request", message: "Missing JSON list of 'docs'", error: true}
Please help, I lost 2 days trying to resolve this problem.
Hi,
i do not know the package 'react-native-pouchdb';
if you want to use this package, do
npm i pouchdb-react-native
import PouchDB from 'pouchdb-react-native'
....
const usrs = new PouchDB('http://127.0.0.1:3000/proba')
....
http and asyncstorage adapter are already bundled
Christoph