MongoDB
 sql >> Database >  >> NoSQL >> MongoDB

Raccolta condivisa tra client e server Meteor

Architettura classica :

lib/streams.js

Streams = new Meteor.Collection("streams"); 

server/streams.js

Meteor.publish("streams", function () {
  return Streams.find();
});

client/streams.js

Meteor.subscribe("streams");

Template.body.helpers({
  streams: function(){
    return Streams.find();
  }
});