Add byContains and byJsonPath

- Add document index functions
This commit is contained in:
2024-06-12 17:43:17 -04:00
parent 65fd46835c
commit 9ecabbe39f
32 changed files with 632 additions and 139 deletions

View File

@@ -65,4 +65,30 @@ class RemoveFields
{
return self::update($tableName, $parameters, Query::whereByFields($fields, $match));
}
/**
* Query to remove fields from documents via a JSON containment query (PostgreSQL only)
*
* @param string $tableName The name of the table in which documents should be manipulated
* @param array $parameters The parameter list for the query
* @return string The UPDATE statement to remove fields from documents via a JSON containment query
* @throws DocumentException If the database mode is not PostgreSQL
*/
public static function byContains(string $tableName, array $parameters): string
{
return self::update($tableName, $parameters, Query::whereDataContains());
}
/**
* Query to remove fields from documents via a JSON Path match query (PostgreSQL only)
*
* @param string $tableName The name of the table in which documents should be manipulated
* @param array $parameters The parameter list for the query
* @return string The UPDATE statement to remove fields from documents via a JSON Path match
* @throws DocumentException
*/
public static function byJsonPath(string $tableName, array $parameters): string
{
return self::update($tableName, $parameters, Query::whereJsonPathMatches());
}
}