-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
27 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -274,7 +274,7 @@ OR | |
] | ||
``` | ||
|
||
# Build options, save optons | ||
#### Build options, save optons | ||
|
||
For each model you can provide build options that are passed to Model.build() and save options that are passed to instance.save(), example: | ||
|
||
|
@@ -296,6 +296,30 @@ For each model you can provide build options that are passed to Model.build() an | |
|
||
``` | ||
|
||
#### Detect duplicates based on select fields | ||
|
||
In case you want to detect duplicates based on specific field or fields rather than all fields (for example, don't include entities with the same id, even if other fields don't match), you can speficy these fields with a 'keys' property. | ||
|
||
```json | ||
{ | ||
"model": "Person", | ||
"keys": ["email"], | ||
"data": { | ||
"name": "John", | ||
"email": "[email protected]" | ||
} | ||
}, | ||
{ | ||
"model": "Person", | ||
"keys": ["email"], | ||
"data": { | ||
"name": "Patrick", | ||
"email": "[email protected]" | ||
} | ||
} | ||
|
||
``` | ||
In this example only John will be loaded | ||
|
||
|
||
# grunt task | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters