【发布时间】:2015-05-14 23:56:53
【问题描述】:
我的模型中有这段代码:
ContentSchema.post( 'remove', function( item ) {
index.deleteObject( item._id )
})
这是我的控制器中的内容:
Content.find( { user: user, _id: contentId } )
.remove( function ( err, count ) {
if ( err || count == 0 ) reject( new Error( "There was an error deleting that content from the stream." ) )
resolve( "Item removed from stream" )
})
我希望当控制器中的函数运行时,模型中的函数应该发生。我可以在调试器中看到它根本没有触发。
我正在使用"mongoose": "3.8.23" 和"mongoose-q": "0.0.16"。
【问题讨论】:
标签: node.js mongodb mongoose mongoose-q