set by default manipulate=False in collection.insert

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Suppose i have a list of documents to insert say `lst`.
      Now if i do `connection.database.collection.insert(lst)` it gives me error
      `pymongo.errors.DuplicateKeyError: E11000 duplicate key error index: database.collection.$id`. So i have to explicitly pass `manipulate=False` to the insert function like this
      `connection.database.collection.insert(lst, manipulate=False)`

      This problem will also appear in case where i do
      `
      for doc in lst:
      connection.database.collection.insert(doc)
      `

      So its better if we keep manipulate=True by default. In case somebody needs the inserted document id he should explicitly pass `manipulate=True`

            Assignee:
            Bernie Hackett
            Reporter:
            Lovesh Harchandani
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: