We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4685740 commit 3c6d022Copy full SHA for 3c6d022
api/server/publications.ts
@@ -5,7 +5,8 @@ import { Chats } from './collections/chats';
5
import { Pictures } from './collections/pictures';
6
7
Meteor.publishComposite('users', function(
8
- pattern: string
+ pattern: string,
9
+ contacts: string[]
10
): PublishCompositeConfig<User> {
11
if (!this.userId) {
12
return;
@@ -15,8 +16,11 @@ Meteor.publishComposite('users', function(
15
16
17
if (pattern) {
18
selector = {
- 'profile.name': { $regex: pattern, $options: 'i' }
19
+ 'profile.name': { $regex: pattern, $options: 'i' },
20
+ 'phone.number': {$in: contacts}
21
};
22
+ } else {
23
+ selector = {'phone.number': {$in: contacts}}
24
}
25
26
return {
0 commit comments