Skip to content

Collection.import_bulk onDuplicate option #42

@khamin

Description

@khamin

Hello,

ArangoDB bulk import supports onDuplicate (error, update, replace, ignore) option.
Could you please implement this one?

Implementation Proposal

This gives an forward compatibility and opportunity to pass custom options to endpoint:

  • Add **kw to Collection.import_bulk signature.
  • Overwrite type, collection, complete keys with current Request params
  • Use resulting dict as Request params.

Example

891c891
<     def import_bulk(self, documents, halt_on_error=True, details=True):
---
>     def import_bulk(self, documents, halt_on_error=True, **kwargs):
910a911,914
>         kwargs['type'] = 'array'
>         kwargs['collection'] = self._name
>         kwargs['complete'] = halt_on_error
> 
915,920c919
<             params={
<                 'type': 'array',
<                 'collection': self._name,
<                 'complete': halt_on_error,
<                 'details': details
<             }
---
>             params=kwargs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions