I use grapher for subscribe
Client
import Conversation from './collection';
import Customer from '../customer/collection';
Conversation.addLinks({
'customer': {
type: 'one',
field: 'customer_id',
collection: Customer
}
});
export default Conversation.createQuery('converation_items',
{
$options:
{
limit:50,
sort:
{
'last_updated': -1,
},
},
created_at: 1,
source_name:1,
unread_message:1,
last_message:1,
last_updated:1,
is_pinned:1,
customer:{
full_name:1,
avatar:1
}
});
Server
import { Meteor } from 'meteor/meteor';
import itemsQuery from './items';
import Validate from '../../_helpers/validate';
import _ from 'lodash';
itemsQuery.expose({
firewall(filters, options)
{
filters.completed = false;
},
/*
maxLimit: 10,
publication: true,
method: false,
blocking: false,
maxDepth: 2,
*/
});
how to set $options on server only not allow set on client
$options:
{
limit:3,
sort:
{
'last_updated': -1,
},
},
Thank you.