timblack1 / rcl

Reformed Churches Locator
Other
2 stars 1 forks source link

Share data between users #70

Closed timblack1 closed 9 years ago

timblack1 commented 9 years ago

Start by putting the congregation data in a global share using Hoodie's global share plugin.

Another problem to resolve is that while it would be good to have all congregation (etc.) data in PouchDB in the browser, it would not be good to replicate all that data to every user database on the server side, because that would take up too much space on the drive.

timblack1 commented 9 years ago

For the following code

hoodie.global.findAll(function(object){
  if (object.type === 'directory' && object.importio_guid === importio_guid){
    return true;
  }
})

the HTTP request sent includes the following in Chrome DevTools' Network tab:

include_docs:true
startkey:"function (object){
            if (object.type === 'directory' && object.importio_guid === importio_guid){
              return true;
            }
          }/"
endkey:"function (object){
            if (object.type === 'directory' && object.importio_guid === importio_guid){
              return true;
            }
          }0"

and the HTTP response is:

{"error":"bad_request","reason":"invalid_json"}

Am I doing something wrong?

Update: This is the same problem as https://github.com/hoodiehq/hoodie-plugin-global-share/issues/13.