Jquery Can';t破坏数据库

Jquery Can';t破坏数据库,jquery,jquery-mobile,pouchdb,Jquery,Jquery Mobile,Pouchdb,我在删除PockDB以重置jQuery移动应用程序时遇到问题 (相当于jsFiddle:) 我在app.js中有: var db = new PouchDB('petrolog'); function resetDb(){ db.destroy(function(err, info) { console.log('Error: ' + err); console.log('Info: ' + info); }); //this is line 38, reference

我在删除PockDB以重置jQuery移动应用程序时遇到问题

(相当于jsFiddle:)

我在app.js
中有:

var db = new PouchDB('petrolog');

function resetDb(){
    db.destroy(function(err, info) { console.log('Error: ' + err); 
       console.log('Info: ' + info); }); //this is line 38, referenced in errors below
    showFillups(); //redraws the UI
}
index.html
中:

<head>
<script src="http://download.pouchdb.com/pouchdb-nightly.js"></script>
</head>

<body>
<a id="btnResetDb" class="ui-shadow ui-btn ui-corner-all">Erase all fillups</a>

<script> $('#btnResetDb').click(function(event){resetDb();}); </script>
</body>
它们对应于
resetDb()

有什么建议吗?我已经在上查看了API文档,但没有找到太多帮助。

方法
destroy()
实际上没有为
info
返回任何内容。
error
为空表示一切都成功

这实际上是PockDB文档中的一个bug,我们将对此进行修复


FWIW,但是,您的JSFIDLE由于不相关的原因无法工作:FIDLE环境似乎无法访问任何本地数据库,因此在Firefox中我看到
错误:找不到有效的适配器

只是一个简单的问题:它说destroy已被弃用,那么,我是否应该将所有条目/文档标记为已删除,然后对其进行压缩?
destroy()
是与压缩不同的操作,不推荐使用的是
db.destroy()
,而不是
db.destroy()
。我会更新文档,让它更清晰。
Error: null        app.js (line 38)
Info: undefined    app.js (line 38)