title: Meteor js aggregate and publish
body: <p>I want to inner join with users and reservations collection which reservation.userId = users._id 
  in meteor.js.
  I want to publish my reservations collection with userObj from users collection
  So I used aggregate,</p>
  
  <pre><code>Meteor.publish("Reservations", function() {
  var options = {
      allowDiskUse: true
  };
  
  var pipeline = [
      {
          $project: {
              _id: 0,
              reservations: "$$ROOT"
          }
      },
      {
          $lookup: {
              localField: "reservations.userId",
              from: "users",
              foreignField: "_id",
              as: "users"
          }
      },
      {
          $unwind: {
              path: "$users",
              preserveNullAndEmptyArrays: false
          }
      },
      {
          $project: {
              "reservations._id": "$reservations._id",
              "reservations.placeId": "$reservations.placeId",
              "reservations.userId": "$reservations.userId",
              "reservations.date": "$reservations.date",
              "users._id": "$users._id",
              "users.profile": "$users.profile",
              _id: 0
          }
      }
  ];
   return Reservations.aggregate(pipeline, options);
    });
  </code></pre>
  
  <p>I am using aggregation (with meteorhacks:aggregate)</p>
  
  <p>but i have some error like this,</p>
  
  <pre><code>I20191023-17:59:56.879(3)? Exception from sub Reservations id Yu9APaNsJKhNhnnGr Error: Publish function can only return a Cursor or an array of Cursors
  I20191023-17:59:56.880(3)?     at Subscription._publishHandlerResult (packages/ddp-server/livedata_server.js:1132:18)
  I20191023-17:59:56.882(3)?     at Subscription._runHandler (packages/ddp-server/livedata_server.js:1063:10)
  I20191023-17:59:56.882(3)?     at Session._startSubscription (packages/ddp-server/livedata_server.js:860:9)
  I20191023-17:59:56.884(3)?     at Session.sub (packages/ddp-server/livedata_server.js:625:12)
  </code></pre>
  
  <p>I used jcbernack:reactive-aggregate package but still doesnt work.</p>
  
  <p>I need some help how would I use the aggregation with publish?</p>