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

Mongo Change Streams not returning all the updates to the collection

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Querying
    • None
    • ALL

    Description

      I am trying to use Change Streams to lookup/monitor the changes to a mongo collection.

      cursor = db.collection.watch(full_document='updateLookup')
      document = next(cursor)
      print document['documentKey']
      

      While using updateMany to update multiple documents at once, I'm not able to see all the changed documents. However if I update one at a time, then I see each change in the Stream.

      db.collection.updateMany( {"contacts.firstName": "XXXXXX"}, { $set: {"LocationId" : 11111} } )
       
      { "acknowledged" : true, "matchedCount" : 77, "modifiedCount" : 77 }
      

      Results:

      {u'_id': ObjectId('580694d039811a468b96fc7b')}
      {u'_id': ObjectId('58aeebed39811a468b974e97')}
      {u'_id': ObjectId('59efe28b39811a468b97b9cc')}
      

      Attachments

        Activity

          People

            kelsey.schubert@mongodb.com Kelsey Schubert
            sambitkhandai SAMBIT P KHANDAI
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: