PouchDB 获取远程数据然后将其从设备中删除
PouchDB get remote data then remove it from device
我正在使用 pouchDB 代替我的 Ionic 应用程序的本地存储。我想从现有的云 pouchdb 数据库中获取数据并临时使用它而不将其保存在我的设备上。
怎么做?
我假设一旦我执行了以下操作,我的数据现在就存储在我的设备上了吗?
var db = new PouchDB('http://website.com:00/database');
db.get('mydoc').then(function(doc) {
//do things
}).catch(function (err) {
console.log(err);
});
- 创建内存中的 PouchDB 数据库(使用内存中的适配器)
- 从源复制到内存中的数据库
I'm assuming once I do the following, my data is now stored on my device right?
没有。如果您连接到远程数据库,则数据不会自动存储在本地。 PouchDB 只是充当远程数据库的客户端。
我正在使用 pouchDB 代替我的 Ionic 应用程序的本地存储。我想从现有的云 pouchdb 数据库中获取数据并临时使用它而不将其保存在我的设备上。
怎么做?
我假设一旦我执行了以下操作,我的数据现在就存储在我的设备上了吗?
var db = new PouchDB('http://website.com:00/database');
db.get('mydoc').then(function(doc) {
//do things
}).catch(function (err) {
console.log(err);
});
- 创建内存中的 PouchDB 数据库(使用内存中的适配器)
- 从源复制到内存中的数据库
I'm assuming once I do the following, my data is now stored on my device right?
没有。如果您连接到远程数据库,则数据不会自动存储在本地。 PouchDB 只是充当远程数据库的客户端。