0
我无法删除我的PouchDB来重置我的jQuery Mobile应用程序。无法销毁PouchDB
(等效的jsfiddle:http://jsfiddle.net/bYR8c/2/)
我在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>
当我按一下按钮,我从萤火如下:
Error: null app.js (line 38)
Info: undefined app.js (line 38)
这些符合我的resetDb()
任何建议db.destroy()
指令?我已经在http://pouchdb.com/api.html#delete_database上检查过API文档,但在那里找不到太多帮助。
只是一个简单的问题:它说摧毁被摧毁了,所以我应该只标记所有被删除的entrys/documents,然后压缩这个东西? – user2741831
'destroy()'是一个与压缩不同的操作,它是'PouchDB.destroy()',不推荐使用'db.destroy()'。我会更新文档以使其更清晰。 – nlawson