Hi!
I can’t see how I have to modelize my application for server/client accessible object.
What I understand: Meteor.call is for the functions called from the client. For the functions only needed for the server, I can make a class object with all my methods inside.
But what happen to an object that have both?
For example I have a collection Notifications. I want the interface to be able to update a list of notification to a read state.
import { Mongo } from 'meteor/mongo';
export const Notifications = new Mongo.Collection('notifications');
Meteor.methods({
'notification.setAsRead': function(doc){
[...]
}
But I want to have a function to send notifications for the server part. So I can make
Notifications = class Notifications {
constructor(doc) {
[...]
}
send(){
[...]
}
But the object Notification is already a Mongo Collection…
How can I deal with this problem?
Thanks for your remarks.