Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new array find operators (#8766)
* added new array find operators; delegating how json and jsonb are stored directly to underlying driver (breaking) * array: true must be explicitly defined for array json/jsonb values; strings being JSON-stringified must be manually escpaed
- Loading branch information
Showing
26 changed files
with
938 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { FindOperator } from "../FindOperator" | ||
|
||
/** | ||
* FindOptions Operator. | ||
* Example: { someField: ArrayContainedBy([...]) } | ||
*/ | ||
export function ArrayContainedBy<T>( | ||
value: T[] | FindOperator<T>, | ||
): FindOperator<any> { | ||
return new FindOperator("arrayContainedBy", value as any) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { FindOperator } from "../FindOperator" | ||
|
||
/** | ||
* FindOptions Operator. | ||
* Example: { someField: ArrayContains([...]) } | ||
*/ | ||
export function ArrayContains<T>( | ||
value: T[] | FindOperator<T>, | ||
): FindOperator<any> { | ||
return new FindOperator("arrayContains", value as any) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { FindOperator } from "../FindOperator" | ||
|
||
/** | ||
* FindOptions Operator. | ||
* Example: { someField: ArrayOverlap([...]) } | ||
*/ | ||
export function ArrayOverlap<T>( | ||
value: T[] | FindOperator<T>, | ||
): FindOperator<any> { | ||
return new FindOperator("arrayOverlap", value as any) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.