mirror of
https://github.com/cnodejs/nodeclub.git
synced 2025-12-08 19:55:55 +00:00
limit the length of message to 20
This commit is contained in:
parent
165e4852f5
commit
a12c3b58a0
@ -73,7 +73,7 @@ exports.getMessageById = function (id, callback) {
|
||||
* @param {Function} callback 回调函数
|
||||
*/
|
||||
exports.getMessagesByUserId = function (userId, callback) {
|
||||
Message.find({master_id: userId}, [], {sort: [['create_at', 'desc']]}, callback);
|
||||
Message.find({master_id: userId}, [], {sort: [['create_at', 'desc']], limit: 20}, callback);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user