If you don't feel like iterating, try FBFriendModel.find({ id:333 }).remove( callback );
or FBFriendModel.find({ id:333 }).remove().exec();
mongoose.model.find
returns a Query, which has a remove
function.
Update for Mongoose v5.5.3 - remove()
is now deprecated. Use deleteOne()
, deleteMany()
or findOneAndDelete() instead.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…