-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
oids = mongokls.objects.insert(mongo_objs_list,load_bulk=False)
Let's say I have created compound index in my db. so when I try to insert objects let say
object1
object2
object3
and both object2,object3 already present in db. In that case, object1 gets inserted successfully. but exception has been thrown. Because of that I don't know which object would be inserted.
Is there a way to know which object is inserted, when there is exception in other docs.?
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
MacHu-GWU commentedon Dec 27, 2019
@iniyanp check
mongoengine_mate
https://github.com/MacHu-GWU/mongoengine_mate-project#smart-insert---skip-primary-key-conflictIt uses an exponential algorithm to segregate your data chunk into small pieces if encountering PrimaryKey conflict. which is way more efficient when you don't know which document will break it.