InsertManyResult with RawBSONDocument has empty inserted_id array

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.7.1
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
              Reporter:
              Kevin Boehme
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: