7
使用MongoDB的W¯¯的node.js,我試圖發現它後,刪除一個項目使用writeConcern沒有提供的回調..但它的失敗MongoDB中:錯誤:無法刪除
- 我得到的集合( db.collection)
- 我發現(collection.findOne)項目
- 我從收集
什麼是錯在我的腳本刪除的項目?
exports.revokeRefreshToken = function (refreshToken, callback) {
db.collection('oauth_refresh_tokens', function(err, collection) {
collection.findOne({'refreshToken': refreshToken}, function(err, item) {
db.collection('oauth_refresh_tokens').remove({_id: item._id});
callback(err);
});
});
};
錯誤提示你需要指定刪除回調。它看起來不像你有一個。 – WiredPrairie
謝謝,我修改了這個函數 – erwin