Skip to content

Commit 52537b7

Browse files
committed
optimize 'classInfo' and 'basicChatInfo' publishments
1 parent 5d41992 commit 52537b7

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

packages/chat/server/publish.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Let's hope that this package is performant.
21
Meteor.publishComposite 'basicChatInfo',
32
find: ->
43
ChatRooms.find {
54
users: @userId
5+
lastMessageTime: $exists: yes
66
},
77
limit: 50 # REVIEW: is this a good value?
88
sort:

server/publish/publish.coffee

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ Meteor.publishComposite 'classInfo', (classId) ->
163163
}
164164
}, {
165165
find: (room) ->
166-
Meteor.users.find _id: $in: room.users
166+
Meteor.users.find {
167+
_id: $in: room.users
168+
}, {
169+
fields: profile: 1
170+
}
167171
}]
168172
}]
169173

0 commit comments

Comments
 (0)