摘要:如何根据注册日期对所有项目进行排序。当我尝试它没有输出时,我的代码如下所示
代码示例:
abcdschema.statics.fetchall = function fetchall(cb) {
var id_temp='abcd';
this.query('id').contains(id_temp).where('regDate').ascending(function(err,res){
console.log(err,res);
})
}
架构
id: {
type: String,
required: true,
hashKey: true
},
name: {
type: String,
required: true,
rangeKey: true
},
regDate: { type: Date, required: true, default: Date.now },
activeFlag: { type: Boolean, default: true }
环境:
- 操作系统:ubuntu
- 操作系统版本:14.04
- Node.js 版本(node -v):9.3.0
- NPM 版本:(npm -v):5.5.1
- Dynamoose 版本:0.8.7