You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow an array of matches in the pattern matching rules
This allows setting multiple matches (a combination of subject, predicate and object) for one definition. The same can be achieved by creating multiple definitions with the same callback/options and a different single match pattern.
Using an object (instead of array) for a `match` is still allowed: this is backwards compatible.
This also changes two aspects of how deltas are sent through:
When a delta matches multiple patterns (matches), it will send the same change sets multiple times to the same url, for every match that is in the rules.
When using an array for `match`es, the change set will only be sent once.
When using in conjunction with `sendMatchesOnly`, all patterns matching those defined in `match`es will be sent in one change set together. When not using an array for `match`es, multiple change sets with "one type of match" each would be sent to the url.
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ export default [
58
58
59
59
The exported property contains an array of definitions, each linking a match to a callback.
60
60
61
-
- `match`: Pattern to match against. Any supplied key must match, anything unspecified is ignored.
61
+
- `match`: Pattern to match against. Any supplied key must match, anything unspecified is ignored. Can pass multiple patterns as a list, which will be combined as an "or" (one valid pattern results in a match).
62
62
- `match.subject`: Matches the subject. Both `type` and `value` may be specified.
63
63
- `match.predicate`: Matches the predicade. Both `type` and `value` may be specified.
64
64
- `match.object`: Matches the object. Both `type` and `value` may be specified.
@@ -72,7 +72,7 @@ The exported property contains an array of definitions, each linking a match to
72
72
- `options.ignoreFromSelf`: Don't inform about changes that originated from the microservice to be informed (based on the hostname).
73
73
- `options.retry`: (experimental) How many times the request is sent again on failure. Defaults to 0. Warning: in case of retries, deltas may be received out of order!
74
74
- `options.retryTimeout`: (experimental) How much time is left in between retries (in ms). Currently defaults to 250ms.
75
-
- `options.sendMatchesOnly`: Only send triples that match, removing the other triples from the changes.
75
+
- `options.sendMatchesOnly`: Only send triples that match the pattern(s), removing the other triples from the changes.
0 commit comments