Skip to content

Commit e94fe28

Browse files
authored
Merge pull request #29 from cipherstash/cip-862-doc-changes
Update README.md
2 parents 55da542 + 0349f41 commit e94fe28

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,35 @@ And is the EQL equivalent of the following plaintext query.
336336
SELECT attrs->'login_count' FROM users;
337337
```
338338
339+
### Field extraction
340+
341+
Extract a field from a JSONB object in a `SELECT` statement:
342+
343+
```sql
344+
SELECT cs_ste_value_v1(attrs, 'DQ1rbhWJXmmqi/+niUG6qw') FROM users;
345+
```
346+
347+
The above is the equivalent to this SQL query:
348+
349+
```sql
350+
SELECT attrs->'login_count' FROM users;
351+
```
352+
353+
354+
### Extraction (in WHERE, ORDER BY)
355+
356+
Select rows that match a field in a JSONB object:
357+
358+
```sql
359+
SELECT * FROM users WHERE cs_ste_term_v1(attrs, 'DQ1rbhWJXmmqi/+niUG6qw') > 'QAJ3HezijfTHaKrhdKxUEg';
360+
```
361+
362+
The above is the equivalent to this SQL query:
363+
364+
```sql
365+
SELECT * FROM users WHERE attrs->'login_count' > 10;
366+
```
367+
339368
## Managing indexes with EQL
340369
341370
These functions expect a `jsonb` value that conforms to the storage schema.

0 commit comments

Comments
 (0)