limit the length of message to 20

This commit is contained in:
jiyinyiyong 2013-07-26 21:06:17 +08:00
parent 165e4852f5
commit a12c3b58a0

View File

@ -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);
};
/**