$sample with `raw: true` does not return correct number of documents being sampled

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Running `aggregate` with `raw: true` as options and `$sample` in the pipeline only returns the `firstBatch` of 100 documents with the rest missing.

      Code:

      this.collection.aggregate([$sample: 300], \{ raw: true })
         .on('error', this.emit.bind(this, 'error'))
         .on('data', this.push.bind(this))
         .on('end', this.push.bind(this, null));
      

       

      Expected: Either cursor of batches with number of documents being sampled, or, since I am streaming, raw individual buffers of data that matches the number of documents being sampled.

              Assignee:
              Matt Broadstone
              Reporter:
              Irina Shestak (Inactive)
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: