pouchdb-react-native icon indicating copy to clipboard operation
pouchdb-react-native copied to clipboard

Can't connect to remote DB

Open vladjap opened this issue 8 years ago • 1 comments

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.

vladjap avatar Nov 14 '17 14:11 vladjap

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

stockulus avatar Nov 14 '17 15:11 stockulus