Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Remotedb #16

Open
wasa4587 opened this issue Sep 14, 2016 · 0 comments
Open

Issue with Remotedb #16

wasa4587 opened this issue Sep 14, 2016 · 0 comments

Comments

@wasa4587
Copy link

Hello,

var localDB = new PouchDB("test");
var remoteDB = new PouchDB("http://localhost:5984/test");
PouchDB.plugin(geopouch);
localDB.sync(remoteDB,{live: true})

//I comment this line after 1st request
//localDB.put({ _id: '_design/foo', spatial: { bar: function (doc) { if(doc.type=='item') emit(doc.geometry); }.toString() } })   

localDB.post({geometry: { type: "Point", coordinates: [20.8215207, -102.76524380000001] },type:'item'}).then(function () {
  console.log('put point');
  return localDB.spatial( 'foo/bar', [ 20, -103, 21, -102 ]);
}).then(function (resp) {
  console.log('query 1');
  console.log(resp);
  return localDB.spatial( 'foo/bar', [ 20, -103, 21, -102 ])
}).then(function (resp) {
  console.log('query 2');
  console.log(resp);
}).catch(function(err) {
  console.log('err')
  console.log(err)
});

It works well in a browser let say chrome, but if i try on other browser opera it returns
image

I'm working with ionic framework, so it also fails on the device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant