Skip to content

Commit 75621a9

Browse files
committed
docs: remove json examples from main readme
1 parent f24e403 commit 75621a9

File tree

1 file changed

+2
-90
lines changed

1 file changed

+2
-90
lines changed

README.md

Lines changed: 2 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -341,96 +341,8 @@ SELECT field, COUNT(*) FROM users GROUP BY field;
341341

342342
## JSON and JSONB support
343343

344-
EQL supports encrypting, decrypting, and searching JSON and JSONB objects.
345-
346-
### Configuring the index
347-
348-
Similar to how you configure indexes for text data, you can configure indexes for JSON and JSONB data.
349-
The only difference is that you need to specify the `cast_as` parameter as `json` or `jsonb`.
350-
351-
```sql
352-
SELECT cs_add_index_v1(
353-
'users',
354-
'encrypted_json',
355-
'ste_vec',
356-
'jsonb',
357-
'{"prefix": "users/encrypted_json"}' -- The prefix is in the form of "table/column"
358-
);
359-
```
360-
361-
You can read more about the index configuration options [here](https://github.com/cipherstash/encrypt-query-language/blob/main/docs/reference/INDEX.md).
362-
363-
### Inserting JSON data
364-
365-
When inserting JSON data, this works the same as inserting text data.
366-
You need to wrap the JSON data in the appropriate EQL payload.
367-
CipherStash Proxy will **encrypt** the data automatically.
368-
369-
**Example:**
370-
371-
Assuming you want to store the following JSON data:
372-
373-
```json
374-
{
375-
"name": "John Doe",
376-
"metadata": {
377-
"age": 42,
378-
}
379-
}
380-
```
381-
382-
The EQL payload would be:
383-
384-
```sql
385-
INSERT INTO users (encrypted_json) VALUES (
386-
'{"v":1,"k":"pt","p":"{\"name\":\"John Doe\",\"metadata\":{\"age\":42}}","i":{"t":"users","c":"encrypted_json"}}'
387-
);
388-
```
389-
390-
Data is stored in the database as:
391-
392-
```json
393-
{
394-
"i": {
395-
"c": "encrypted_json",
396-
"t": "users"
397-
},
398-
"k": "sv",
399-
"v": 1,
400-
"sv": [
401-
["ciphertext"]
402-
]
403-
}
404-
```
405-
406-
### Reading JSON data
407-
408-
When querying data, select the encrypted column. CipherStash Proxy will **decrypt** the data automatically.
409-
410-
**Example:**
411-
412-
```sql
413-
SELECT encrypted_json FROM users;
414-
```
415-
416-
Data is returned as:
417-
418-
```json
419-
{
420-
"k": "pt",
421-
"p": "{\"metadata\":{\"age\":42},\"name\":\"John Doe\"}",
422-
"i": {
423-
"t": "users",
424-
"c": "encrypted_json"
425-
},
426-
"v": 1,
427-
"q": null
428-
}
429-
```
430-
431-
### Advanced JSON queries
432-
433-
We support a wide range of JSON/JSONB functions and operators.
344+
EQL supports encrypting entire JSON and JSONB data sets.
345+
This warrants a separate section in the documentation.
434346
You can read more about the JSONB support in the [JSONB reference guide](docs/reference/JSON.md).
435347

436348
## Frequently Asked Questions

0 commit comments

Comments
 (0)