Mongoose by时间查询

// API 层

moment = require("moment"),

startDate: moment(params.startDate).format('YYYY-MM-DD'),


//查找时间段:

if (typeof(appointment_time) != "undefined" && appointment_time != null && appointment_time != '') {
//query.appointment_time = {};
query.appointment_time = {$gte:moment(appointment_time).format('YYYY-MM-DD'),
$lt: moment(appointment_time).add(1, 'days').format('YYYY-MM-DD')};
}

//Dao 层
var query = this.model.find(param).skip(skipFrom).limit(resultsPerPage).populate('merchant').populate('principal').populate('store');



posted @ 2015-04-22 14:41  八喜小狐狸  阅读(553)  评论(0编辑  收藏  举报