Skip to content

Commit 0349f41

Browse files
authored
Try to make the examples a little clearer
Repeat the structure of the other examples
1 parent 0cbc75f commit 0349f41

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -336,25 +336,33 @@ And is the EQL equivalent of the following plaintext query.
336336
SELECT attrs->'login_count' FROM users;
337337
```
338338
339-
### Extraction (in SELECT)
339+
### Field extraction
340+
341+
Extract a field from a JSONB object in a `SELECT` statement:
340342
341-
Extract a field from a JSONB object for use in a `SELECT` statement.
342-
:abc: Plaintext
343343
```sql
344-
SELECT attrs->'login_count' FROM users;
344+
SELECT cs_ste_value_v1(attrs, 'DQ1rbhWJXmmqi/+niUG6qw') FROM users;
345345
```
346-
:white_check_mark: EQL
346+
347+
The above is the equivalent to this SQL query:
348+
347349
```sql
348-
SELECT cs_ste_value_v1(attrs, 'DQ1rbhWJXmmqi/+niUG6qw') FROM users;
350+
SELECT attrs->'login_count' FROM users;
349351
```
352+
353+
350354
### Extraction (in WHERE, ORDER BY)
351-
:abc: Plaintext
355+
356+
Select rows that match a field in a JSONB object:
357+
352358
```sql
353-
SELECT * FROM users WHERE attrs->'login_count' > 10;
359+
SELECT * FROM users WHERE cs_ste_term_v1(attrs, 'DQ1rbhWJXmmqi/+niUG6qw') > 'QAJ3HezijfTHaKrhdKxUEg';
354360
```
355-
:white_check_mark: EQL
361+
362+
The above is the equivalent to this SQL query:
363+
356364
```sql
357-
SELECT * FROM users WHERE cs_ste_term_v1(attrs, 'DQ1rbhWJXmmqi/+niUG6qw') > 'QAJ3HezijfTHaKrhdKxUEg';
365+
SELECT * FROM users WHERE attrs->'login_count' > 10;
358366
```
359367
360368
## Managing indexes with EQL

0 commit comments

Comments
 (0)