ስርጭቶች እና ደምበኝነቶች

የጎን ኣሞሌ 4.5

የተተረጎመው መጠን

በዚህ ምዕራፍ:

  • ስርጭቶች እና ደምበኝነቶች እንዴት እንደሚሰሩ ይረዱ።
  • የነባሪው ኣውቶፓብሊሽ (Autopublish) ጥቅል ምን እንደሚሰራ ይማሩ።
  • ስለስርጭቶች ስርዓተ ጥለት ተጨማሪ ምሳሌዎችን ይመልከቱ።
  • ////

    ////

    ////

    The Olden Days

    ////

    ////

    ////

    ////

    ////

    የሚትዩር መንገድ

    ////

    Pushing a subset of the database to the client.
    Pushing a subset of the database to the client.

    ////

    ////

    ////

    ማሰራጨት

    ////

    ////

    ////

    All the posts contained in our database.
    All the posts contained in our database.

    ////

    ////

    Excluding flagged posts.
    Excluding flagged posts.

    ////

    // on the server
    Meteor.publish('posts', function() {
      return Posts.find({flagged: false}); 
    });
    

    ////

    ዲዲፒ

    ////

    ////

    ደንበኝነት

    ////

    ////

    ////

    Subscribing to Bob's posts will mirror them on the client.
    Subscribing to Bob’s posts will mirror them on the client.

    ////

    // on the server
    Meteor.publish('posts', function(author) {
      return Posts.find({flagged: false, author: author});
    });
    

    ////

    // on the client
    Meteor.subscribe('posts', 'bob-smith');
    

    ////

    ማግኘት

    ////

    Selecting a subset of documents on the client.
    Selecting a subset of documents on the client.

    ////

    // on the client
    Template.posts.helpers({
      posts: function(){
        return Posts.find(author: 'bob-smith', category: 'JavaScript');
      }
    });
    

    ////

    ራስ-ስርጭት (Autopublish)

    ////

    ////

    Autopublish
    Autopublish

    ////

    ////

    ////

    ስብስቦችን ሙሉበሙሉ ማሰራጨት

    ////

    Meteor.publish('allPosts', function(){
      return Posts.find();
    });
    
    Publishing a full collection
    Publishing a full collection

    ////

    ስብስቦችን በከፊል ማሰራጨት

    ////

    Meteor.publish('somePosts', function(){
      return Posts.find({'author':'Tom'});
    });
    
    Publishing a partial collection
    Publishing a partial collection

    ከበስተጀርባ

    ////

    ////

    ////

    ////

    • ////
    • ////
    • ////

    ////

    መገለጫዎችን በከፊል ማሰራጨት

    ////

    ////

    Meteor.publish('allPosts', function(){
      return Posts.find({}, {fields: {
        date: false
      }});
    });
    
    Publishing partial properties
    Publishing partial properties

    ////

    Meteor.publish('allPosts', function(){
      return Posts.find({'author':'Tom'}, {fields: {
        date: false
      }});
    });
    

    ማጠቃለያ

    ////

    ////

    ////