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