Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4170

Where has bulk insert gone with Mongoid 5

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 12_01_17
    • Affects Version/s: 5.0.0
    • Component/s: None
    • Environment:
      Any

      I started using Mongoid 5 gem and so far looks OK in my Rails projects.

      But I am also doing lots of batch data importing. My first observation was that loops with 1000 find_by clauses went from less then 3 seconds to more than 4 seconds. Which I can tolerate.

      Bigger problem is that bulk inserting doesn't work anymore. Bulk inserts are more than 10x faster on Mongoid 4 so I would like to know, how to accomplish them in Mongoid 5.

      Old code: result = MyCollection.collection.insert(@bulk) throws undefined method `insert' for #<Mongo::Collection:0x4f3039b0>" exception.

      Thank for your reply
      Damjan Rems (http://www.drgcms.org)

            Assignee:
            Unassigned Unassigned
            Reporter:
            d_rems@yahoo.com Damjan Rems
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: