Skip to content

Issue with Remotedb #16

Description

@wasa4587

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions