logo
  • 教程列表
  • SO官方文檔
  • 釋出資料
    • 全域性出版物
    • 建立並響應釋出上的錯誤
    • 模板作用域訂閱
    • 命名出版物
    • 在釋出時驗證使用者帳戶
    • 基本訂閱和出版
    • 釋出到一個短暫的客戶端命名集合
    • 反應性地重新訂閱出版物
    • 正在提取已釋出的資料時,請在 Blaze 檢視中等待
    • 模擬出版物的延遲
    • 釋出多個遊標
    • 合併出版物
  1. StackOverflow 文件
  2. meteor 教程
  3. 釋出資料
  4. 釋出多個遊標

釋出多個遊標

Created: November-22, 2018

通過返回遊標陣列,可以從同一釋出方法釋出多個資料庫遊標。

兒童遊標將被視為連線,不會被動反應。

Meteor.publish('USER_THREAD', function(postId) {
  let userId   = this.userId;

  let comments = Comments.find({ userId, postId });
  let replies  = Replies.find({ userId, postId });

  return [comments, replies];
});
  • 合併出版物
  • 模擬出版物的延遲

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明