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

Where has bulk insert gone with Mongoid 5

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Community Answered
    • Affects Version/s: 5.0.0
    • Fix Version/s: 12_01_17
    • Component/s: None
    • Labels:
    • Environment:
      Any

      Description

      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)

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ther Damjan Rems
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: