Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1085

Bulk Write ids not fully returned

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.2.3
    • Affects Version/s: 2.2.2
    • Component/s: None
    • None

      Hi,

      I ran into some troubles while trying to get back _id of inserted documents.

      arr = []                                                                                                               
                                                                                                                             
      (0...10000).each do |x|                                                                                                
        arr << {x: x}                                                                                                        
      end                                                                                                                    
                                                                                                                             
      res = db['test'].insert_many(arr)                                                                                      
      puts res.inserted_count                                                                                                
      puts res.inserted_ids.length
      

      I get as result:

      n = 10000
      ids = 625

      As what I understand from the documentation those numbers should be equal no ?

      I use the 2.2.2 version of the driver and Mongo 3.2.1.
      I have not tested this on prior versions

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            chambo_e Emmanuel Chambon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: