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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      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

      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.

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

              Created:
              Updated:
              Resolved: