Skip to content

Update README.md #29

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

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Changes from all commits
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
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,35 @@ And is the EQL equivalent of the following plaintext query.
SELECT attrs->'login_count' FROM users;
```

### Field extraction

Extract a field from a JSONB object in a `SELECT` statement:

```sql
SELECT cs_ste_value_v1(attrs, 'DQ1rbhWJXmmqi/+niUG6qw') FROM users;
```

The above is the equivalent to this SQL query:

```sql
SELECT attrs->'login_count' FROM users;
```


### Extraction (in WHERE, ORDER BY)

Select rows that match a field in a JSONB object:

```sql
SELECT * FROM users WHERE cs_ste_term_v1(attrs, 'DQ1rbhWJXmmqi/+niUG6qw') > 'QAJ3HezijfTHaKrhdKxUEg';
```

The above is the equivalent to this SQL query:

```sql
SELECT * FROM users WHERE attrs->'login_count' > 10;
```

## Managing indexes with EQL

These functions expect a `jsonb` value that conforms to the storage schema.
Expand Down