androiddatabasecouchdbtouchdb

How do I push from a couchdb server to a touchdb client?


I am trying to push data from my couchdb server to a touchdb app (grocery-sync sample) running on an android x86 vm. The replication with the app works normally where the app does the pulling and pushing. I am unable to push from the server to the touch db client. When I try I get the following error:

{"error":"db_not_found","reason":"couldnotopenhttp://192.168.100.101/grocery-sync/"}.

Any assistance will be appreciated. Thanks.


Solution

  • You almost certainly do not want to do this. You should assume that your mobile clients will be on dynamic IP addresses. Switching between wi-fi and cellular will create a new IP address. The server needs a URL to replicate to.

    TouchDB was designed for the use case of the mobile client pulling from the server. In order to push to the client, TouchDB will need to handle all the correct HTTP requests which the server will make. Many of these don't make sense for the current use cases of TouchDB, so I doubt that they will be added anytime soon.