MCPcopy Create free account
hub / github.com/dolthub/doltgresql / RemoveString

Method RemoveString

postgres/parser/json/json.go:1419–1429  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

1417}
1418
1419func (j jsonObject) RemoveString(s string) (JSON, bool, error) {
1420 idx, ok := findPairIndexByKey(j, s)
1421 if !ok {
1422 return j, false, nil
1423 }
1424
1425 newVal := make([]jsonKeyValuePair, len(j)-1)
1426 copy(newVal, j[:idx])
1427 copy(newVal[idx:], j[idx+1:])
1428 return jsonObject(newVal), true, nil
1429}
1430
1431func (jsonNull) RemoveString(string) (JSON, bool, error) {
1432 return nil, false, errCannotDeleteFromScalar

Callers 1

doRemovePathMethod · 0.95

Calls 2

findPairIndexByKeyFunction · 0.85
jsonObjectTypeAlias · 0.85

Tested by

no test coverage detected