1
你好,我想刪除蒙戈DB特定的輸入...我現在用的是mongolian 客戶端,我很抱歉,我沒有設法掌握尚API ...如何在node-mongolian上使用dropIndex()?
這樣的嘗試失敗
if(req.body.post.del){
posts.dropIndex({_id:req.body.post.del}, function(err){ //this query must be wrong
if(err)
res.render('blog_edit', {locals:{title:'Failure to delete from DB'}}); //this is what I get...
else
posts.find({}).toArray(function(err, arr){
if(err) throw err
res.render('blog_edit', {locals:{title:'Success!', posts: arr }});
})
})
}
請提供一些幫助...... 在此先感謝!