84669 人が学習中
152542 人が学習中
20005 人が学習中
5487 人が学習中
7821 人が学習中
359900 人が学習中
3350 人が学習中
180660 人が学習中
48569 人が学習中
18603 人が学習中
40936 人が学習中
1549 人が学習中
1183 人が学習中
32909 人が学習中
exports.Post = mongolass.model('Post', {author: { type: Mongolass.Types.ObjectId },title: { type: 'string' },content: { type: 'string' },pv: { type: 'number' }});exports.Post.index({ author: 1, _id: -1 }).exec();// 按创建时间降序查看用户的文章列表 这里如何理解?
闭关修行中......
exports.Post.index({ author: 1, _id: -1 }).exec();
上述代码是在创建复合索引(author 升序 , _id 降序)
供参考。
Love MongoDB! Have Fun!
exports.Post.index({ author: 1, _id: -1 }).exec();
上述代码是在创建复合索引(author 升序 , _id 降序)
供参考。
Love MongoDB! Have Fun!