Meteor 查询排序错误 "Requests.find(...).sort is not a function"
Meteor query sort error "Requests.find(...).sort is not a function"
我需要对 "datetime" 升序格式进行排序。但是出现错误“Requests.find(...).sort is not a function
” meteor mini mongo find
var results = Requests.find({
"sp_id": request.sp_id,
"slot": request.slot,
"date": request.date,
"datetime": {
'$gte': request.datetime
},
"status": {
$nin: ['cancel', 'completed']
}
}
).sort({datetime: 1}).fetch();
console.log(results);
谢谢。
语法为:
const query = { your: 'query' };
const options = { sort: { datetime: 1 } };
const results = Requests.find(query, options).fetch();
看看docs。
我需要对 "datetime" 升序格式进行排序。但是出现错误“Requests.find(...).sort is not a function
” meteor mini mongo find
var results = Requests.find({
"sp_id": request.sp_id,
"slot": request.slot,
"date": request.date,
"datetime": {
'$gte': request.datetime
},
"status": {
$nin: ['cancel', 'completed']
}
}
).sort({datetime: 1}).fetch();
console.log(results);
谢谢。
语法为:
const query = { your: 'query' };
const options = { sort: { datetime: 1 } };
const results = Requests.find(query, options).fetch();
看看docs。