Skip to content

Commit

Permalink
Update pg-ops/- docstring wrt array input
Browse files Browse the repository at this point in the history
The `-` operator also works for arrays:

```sql
select '{"a":1,"b":2,"c":3}' - array['a','b'];
-- => {c:3}
select '["a","b","c"]'::jsonb - array['a','b']
-- => ["c"]
```
  • Loading branch information
holyjak authored Jul 4, 2024
1 parent 4e12409 commit e7ef940
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/honey/sql/pg_ops.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
(def -
"The - operator:
- text value: deletes a key (and its value) from a JSON object, or matching string value(s) from a JSON array
- text[] array value: as above, but for all the provided keys
- int value: deletes the array element with specified index (negative integers count from the end)"
:-)
(def hash- "The #- operator - deletes the field or array element at the specified path, where path elements can be either field keys or array indexes." :#-)
Expand Down

0 comments on commit e7ef940

Please # to comment.