Skip to content

How do I skip duplicate documents in a bulk insert? #1465

Open
@rohitkhatri

Description

@rohitkhatri

I'm trying to insert documents in bulk, I have created a unique index in my collection and want to skip documents which are duplicate while doing bulk insertion. This can be accomplished with native mongodb function:

db.collection.insert(
	<document or array of documents>,
	{
		ordered: false
	}
)

How can I achieve this in mongoengine?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions