Skip to content

Commit 0cbc75f

Browse files
authored
Update README.md
Added in supported JSONB extract operations
1 parent 354c931 commit 0cbc75f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,27 @@ And is the EQL equivalent of the following plaintext query.
336336
SELECT attrs->'login_count' FROM users;
337337
```
338338
339+
### Extraction (in SELECT)
340+
341+
Extract a field from a JSONB object for use in a `SELECT` statement.
342+
:abc: Plaintext
343+
```sql
344+
SELECT attrs->'login_count' FROM users;
345+
```
346+
:white_check_mark: EQL
347+
```sql
348+
SELECT cs_ste_value_v1(attrs, 'DQ1rbhWJXmmqi/+niUG6qw') FROM users;
349+
```
350+
### Extraction (in WHERE, ORDER BY)
351+
:abc: Plaintext
352+
```sql
353+
SELECT * FROM users WHERE attrs->'login_count' > 10;
354+
```
355+
:white_check_mark: EQL
356+
```sql
357+
SELECT * FROM users WHERE cs_ste_term_v1(attrs, 'DQ1rbhWJXmmqi/+niUG6qw') > 'QAJ3HezijfTHaKrhdKxUEg';
358+
```
359+
339360
## Managing indexes with EQL
340361
341362
These functions expect a `jsonb` value that conforms to the storage schema.

0 commit comments

Comments
 (0)