Sails.js 我们可以在sails js集合中使用嵌套where子句吗
我试图在下面的查询中获得开始日期大于当前日期的输出 以下是我收藏的结构:Sails.js 我们可以在sails js集合中使用嵌套where子句吗,sails.js,sails-mongo,Sails.js,Sails Mongo,我试图在下面的查询中获得开始日期大于当前日期的输出 以下是我收藏的结构: { "_id" : ObjectId("5aeac6cd1b7e6f252832ca0e"), "recruiter_id" : null, "university_id" : null, "type" : "quiz", "name" : "Enter scheduled quiz without end date", "description" : "Even
{
"_id" : ObjectId("5aeac6cd1b7e6f252832ca0e"),
"recruiter_id" : null,
"university_id" : null,
"type" : "quiz",
"name" : "Enter scheduled quiz without end date",
"description" : "Even after detailed market research, some products just don't work in the market. Here's a case study from the Coca-Cola range. ",
"quizpoll_image" : "story_7.jpeg",
"status" : "1",
"quizpoll_type" : "scheduled",
"duration" : {
"duration_type" : "Question wise",
"total_duration" : "1000"
},
"questions" : [
{
"question_id" : "5aeaa4021b7e6f00dc80c5c6"
},
{
"question_id" : "5aeaa59d1b7e6f00dc80c5d2"
}
],
"date_type" : {
"start_date" : ISODate("2018-05-01T00:00:00.000+0000")
},
"created_at" : ISODate("2018-05-01T00:00:00.000+0000"),
"updated_at" : ISODate("2018-04-26T07:58:17.795+0000")
}
这是我正在尝试的查询:
var isoCurrentDate = current_date.toISOString();
var quizScheduledData = await QuizListingCollection.find({
where: ({
'type':'quiz',
'status':'1',
'quizpoll_type':'scheduled',
'date_type' :{
'start_date':{
'>': isoCurrentDate
}
}
})
});
这就是我在《邮递员》中遇到的错误
{
"cause": {
"name": "UsageError",
"code": "E_INVALID_CRITERIA",
"details": "Could not use the provided `where` clause. Could not filter by `date_type`: Unrecognized modifier (`start_date`) within provided constraint for `date_type`."
},
"isOperational": true,
"code": "E_INVALID_CRITERIA",
"details": "Could not use the provided `where` clause. Could not filter by `date_type`: Unrecognized modifier (`start_date`) within provided constraint for `date_type`."
}
操作员我之前试过这个,但它也不起作用。我试过它不起作用,尽管我正在尝试其他工作
{
where: {
'type':'quiz',
'status':'1',
'quizpoll_type':'scheduled',
'date_type.start_date': {
'>' : isoCurrentDate
}
}
}