Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-19958

aggregate([{$out}]) produces a different collection than an insert()

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Aggregation Framework
    • None
    • ALL
    • Hide

      Here is an app that can reproduce the error: https://github.com/keyscores/meteor-aggregation-issue

      just clone,
      > cd meteor-aggregation-issue
      >meteor

      Show
      Here is an app that can reproduce the error: https://github.com/keyscores/meteor-aggregation-issue just clone, > cd meteor-aggregation-issue >meteor

    Description

      There is a persistent issue using Mongo aggregate with reactive frameworks like Meteor. The $out operator invalidates reactive updates, which are otherwise possible with insert().

      What could be different about the collections created aggregate([$out]) than insert()?

      See here:
      http://stackoverflow.com/questions/31996392/does-mongos-aggregate-with-out-create-invalid-collections

      and here:
      https://github.com/meteor/meteor/issues/4947

      Seems like Mongo's aggregate() when using $out, somehow produces a different collection than an insert() of the same data. I'm only guessing this because I'm getting very different behaviors.

      I'm testing this in Meteor, and collections created with aggregate([$out]) are not observable by the app. I'm not sure why this would be the case, since the collection looks fine in the Mongo console.

      Attachments

        Activity

          People

            Unassigned Unassigned
            lpg Lucas Geiger
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: