Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1800

InsertManyResult with RawBSONDocument has empty inserted_id array

    • Type: Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.7.1
    • Component/s: None
    • Labels:
      None

      From a high level my code:

      1. Runs an aggregation using "aggregate_raw_batches"
      2. Maps the resulting cursor to a RawBSONDocument
      3. Run an insert_many using the results of #2
      4. Checks the results of the insert_many for the "inserted_id" field.
      5. Find that this field is always an empty array even when I verified it is correctly inserting documents.

       

      raw_cursor = my_coll.aggregate_raw_batches(multi_sample_pipeline,allowDiskUse=True,maxTimeMS=180)
      mapped_docs = map(RawBSONDocument,pedigree_results_bson_cursor)
      results = diff_coll.insert_many(mapped_docs,ordered=False)

      print(len(results.inserted_ids)) # Seemingly always 0, even when inserting non zero number of documents.

            Assignee:
            Unassigned Unassigned
            Reporter:
            kboehme Kevin Boehme
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: