Skip to main content
The API uses type for Database and app for Space. See Terminology.
Creates Entity (or Entities) if no existing duplicate is found (based on the Conflict Field); otherwise, it either skips creating or updates the existing duplicate, depending on the Conflict Action.
Setting the fibery/id Field for Entities is mandatory to apply the Conflict Action when a duplicate is found.
The Conflict Field can be of type: fibery/text, fibery/int, or fibery/date
If a batch of Entities is passed to the command and it contains Duplicates, the following action is taken:
  • skip-create: Uses the first found Duplicate in the batch.
  • update-latest: Uses the last found Duplicate in the batch.
Duplicate matching rules:
  • NULL values are not considered equal. An entity with a NULL Conflict Field value is not considered a Duplicate of another entity with a NULL value.
  • Text Field comparisons are case-sensitive.
The result is an array of created Entities or resolved Conflicts, in the order of the Entities. The array contents are determined as follows:
  • Created: If an Entity was created, the array contains the new Entity’s information with create action.
  • Skipped: If an Entity was not created because skip-create was applied to a found Duplicate, the array contains a resolved Conflict with skip-create action.
  • Updated: If an Entity was used to update a found Duplicate due to update-latest, the array contains a resolved Conflict with update-latest action.
  • Batch Duplicate handling: If an Entity was ignored due to a Duplicate found within the same batch of Entities, the array contains a resolved Conflict with prefer-duplicate-found-in-the-batch action. This action uses the Duplicate entity (D) and resolves it by applying the specified Conflict Action later:
  • If no Conflict is found for D, the array contains the created Entity D info with create action.
  • If a Conflict is found for D and resolved with skip-create, the array contains a resolved Conflict with skip-create action.
  • If a Conflict is found for D and resolved with update-latest, the array contains a resolved Conflict with update-latest action.

Case 1

  • Batch of Entities contain duplicates
  • There are no existing duplicates in the DB
  • Conflict Action is skip-create
Result:

Case 2

  • Batch of Entities contains duplicates
  • There are existing duplicates in the DB
  • Conflict Action is skip-create
Result:

Case 3

  • Batch of Entities contains duplicates
  • There are no existing duplicates in the DB
  • Conflict Action is update-latest
Result:

Case 4

  • Batch of Entities contains duplicates
  • There are existing duplicates in the DB
  • Conflict Action is update-latest
Result: