我正在尝试使用低于请求中的 destroy
方法,但无法使其正常工作。
尽管如此,find
方法会返回一些具有完全相同参数的内容。
Cars.find({userId: params.userId, accessDate: { '<=': new Date() }}, function (err, found) {
console.log(found); //Returns an array with multiple entries.
});
Cars.destroy({userId: params.userId, accessDate: { '<=': new Date() }}); //Does nothing, the entries are not destroyed.
这是我的数据库中第一个请求返回的内容:
[ { userId: '563c1c37be1ed48e7f8c6ada',
accessDate: '2015-11-07T21:36:13.169Z',
id: '563e60bd19667c52bd831182' },
{ userId: '563c1c37be1ed48e7f8c6ada',
accessDate: '2015-11-10T05:04:01.850Z',
id: '56416cb140112987ce6ec049' },
{ userId: '563c1c37be1ed48e7f8c6ada',
accessDate: '2015-11-12T03:59:36.519Z',
id: '5644009851503b42e589ecf1' } ]
我有什么地方说错了吗?我该怎么办?
谢谢。
最佳答案
Cars.find({userId: params.userId, accessDate: { '<=': new Date() }})
.exec(function (err, found) {
});
Cars.destroy({userId: params.userId, accessDate: { '<=': new Date() }})
.exec(function (err) {
});
希望有帮助
关于javascript - Sails.js 水线破坏 "lower or equal"标准,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33664119/