I want to create a html page which synchronize JSON data with pouch Db. The JSON data is a response from a web service.I have created a sample html file which can create a pouch Db database.I have created rest web service which gives certain data as response. can any one help me to synchronize these two.
问问题
3382 次
2 回答
2
现在有一个库可以将 JSON 字符串(转储)作为数据库导入 PouchDB。
它被称为PouchDB-Load,由 PouchDB 作者 Nolan Lawson 编写。
因此,在您的情况下,代码可以很简单:
var db = new PouchDB('my-awesome-db');
db.load('http://example.com/my-dump-file.json').then(function () {
// done loading!
}).catch(function (err) {
// HTTP error or something like that
});
于 2017-02-09T16:28:53.500 回答