Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document :exists #33

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions _docs/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ This will generate a rule that fires if the Customer fact has a vip status, **or

For further information, see [Boolean Expressions](/docs/booleans).

## Exists Expressions

Exists expresssions only test for the existence or absence of matching facts without triggering for every instance of the fact. For example:

{% highlight clojure %}
[:exists [Person (= name "Bob")]]
{% endhighlight %}

This will trigger the _first_ time a Person with the name "Bob" is inserted, but not the second or third. It will only retract after all supporting facts are removed.

eraserhd marked this conversation as resolved.
Show resolved Hide resolved
## Tests
![test expression](/img/diagram/TEST_EXPR.png)

Expand Down