-
- /*
- * if we are not deaing with an array first check to make sure the key exists
- * this is potentially just extra unwanted work
- */
- if (!JB_ROOT_IS_ARRAY(input_jsonb))
- {
- jsonb_lookup_key.type = jbvString;
- jsonb_lookup_key.val.string.val = VARDATA_ANY(input_text);
- jsonb_lookup_key.val.string.len = VARSIZE_ANY_EXHDR(input_text);
-
- jsonb_lookup_value = findJsonbValueFromContainer(&input_jsonb->root,
- JB_FOBJECT | JB_FARRAY, &jsonb_lookup_key);
-
- if (jsonb_lookup_value == NULL)
- PG_RETURN_JSONB(input_jsonb);
- }