UNPKG

ravendb

Version:
220 lines 8.79 kB
import { IDocumentQueryBase } from "./IDocumentQueryBase.js"; import { IQueryBase } from "./IQueryBase.js"; import { SearchOperator } from "../Queries/SearchOperator.js"; import { MethodCall } from "./MethodCall.js"; import { WhereParams } from "./WhereParams.js"; import { SpatialUnits, SpatialRelation } from "../Indexes/Spatial.js"; import { SpatialCriteria } from "../Queries/Spatial/SpatialCriteria.js"; import { SpatialCriteriaFactory } from "../Queries/Spatial/SpatialCriteriaFactory.js"; import { IDocumentQuery } from "./IDocumentQuery.js"; import { DynamicSpatialField } from "../Queries/Spatial/DynamicSpatialField.js"; import { MoreLikeThisBase } from "../Queries/MoreLikeThis/MoreLikeThisBase.js"; import { Field } from "../../Types/index.js"; export interface IFilterDocumentQueryBase<T extends object, TSelf extends IDocumentQueryBase<T, TSelf>> extends IQueryBase<T, TSelf> { /** * Negate the next operation */ not(): TSelf; /** * Add an AND to the query */ andAlso(): TSelf; /** * Add an AND to the query */ andAlso(wrapPreviousQueryClauses: boolean): TSelf; /** * Simplified method for closing a clause within the query */ closeSubclause(): TSelf; /** * Performs a query matching ALL of the provided values against the given field (AND) */ containsAll(fieldName: Field<T>, values: any[]): TSelf; /** * Performs a query matching ANY of the provided values against the given field (OR) */ containsAny(fieldName: Field<T>, values: any[]): TSelf; /** * Negate the next operation */ negateNext(): TSelf; /** * Simplified method for opening a new clause within the query */ openSubclause(): TSelf; /** * Add an OR to the query */ orElse(): TSelf; /** * Perform a search for documents which fields that match the searchTerms. * If there is more than a single term, each of them will be checked independently. * * Space separated terms e.g. 'John Adam' means that we will look in selected field for 'John' * or 'Adam'. */ search(fieldName: Field<T>, searchTerms: string): TSelf; /** * Perform a search for documents which fields that match the searchTerms. * If there is more than a single term, each of them will be checked independently. * * Space separated terms e.g. 'John Adam' means that we will look in selected field for 'John' * or 'Adam'. */ search(fieldName: Field<T>, searchTerms: string, operator: SearchOperator): TSelf; /** * Filter the results from the index using the specified where clause. */ whereLucene(fieldName: Field<T>, whereClause: string): TSelf; /** * Filter the results from the index using the specified where clause. */ whereLucene(fieldName: Field<T>, whereClause: string, exact: boolean): TSelf; /** * Matches fields where the value is between the specified start and end, inclusive */ whereBetween(fieldName: Field<T>, start: any, end: any): TSelf; /** * Matches fields where the value is between the specified start and end, inclusive */ whereBetween(fieldName: Field<T>, start: any, end: any, exact: boolean): TSelf; /** * Matches fields which ends with the specified value. */ whereEndsWith(fieldName: Field<T>, value: any): TSelf; /** * Matches fields which ends with the specified value. */ whereEndsWith(fieldName: Field<T>, value: any, exact: boolean): TSelf; /** * Matches value */ whereEquals(fieldName: Field<T>, value: any): TSelf; /** * Matches value */ whereEquals(fieldName: Field<T>, value: any, exact: boolean): TSelf; /** * Matches value */ whereEquals(fieldName: Field<T>, method: MethodCall): TSelf; /** * Matches value */ whereEquals(fieldName: Field<T>, method: MethodCall, exact: boolean): TSelf; /** * Matches value */ whereEquals(whereParams: WhereParams): TSelf; /** * Not matches value */ whereNotEquals(fieldName: Field<T>, value: any): TSelf; /** * Not matches value */ whereNotEquals(fieldName: Field<T>, value: any, exact: boolean): TSelf; /** * Not matches value */ whereNotEquals(fieldName: Field<T>, method: MethodCall): TSelf; /** * Not matches value */ whereNotEquals(fieldName: Field<T>, method: MethodCall, exact: boolean): TSelf; /** * Not matches value */ whereNotEquals(whereParams: WhereParams): TSelf; /** * Matches fields where the value is greater than the specified value */ whereGreaterThan(fieldName: Field<T>, value: any): TSelf; /** * Matches fields where the value is greater than the specified value */ whereGreaterThan(fieldName: Field<T>, value: any, exact: boolean): TSelf; /** * Matches fields where the value is greater than or equal to the specified value */ whereGreaterThanOrEqual(fieldName: Field<T>, value: any): TSelf; /** * Matches fields where the value is greater than or equal to the specified value */ whereGreaterThanOrEqual(fieldName: Field<T>, value: any, exact: boolean): TSelf; /** * Check that the field has one of the specified values */ whereIn(fieldName: Field<T>, values: any[]): TSelf; /** * Check that the field has one of the specified values */ whereIn(fieldName: Field<T>, values: any[], exact: boolean): TSelf; /** * Matches fields where the value is less than the specified value */ whereLessThan(fieldName: Field<T>, value: any): TSelf; /** * Matches fields where the value is less than the specified value */ whereLessThan(fieldName: Field<T>, value: any, exact: boolean): TSelf; /** * Matches fields where the value is less than or equal to the specified value */ whereLessThanOrEqual(fieldName: Field<T>, value: any): TSelf; /** * Matches fields where the value is less than or equal to the specified value */ whereLessThanOrEqual(fieldName: Field<T>, value: any, exact: boolean): TSelf; /** * Matches fields which starts with the specified value. */ whereStartsWith(fieldName: Field<T>, value: any): TSelf; /** * Matches fields which starts with the specified value. */ whereStartsWith(fieldName: Field<T>, value: any, exact: boolean): TSelf; /** * Check if the given field exists */ whereExists(fieldName: Field<T>): TSelf; /** * Checks value of a given field against supplied regular expression pattern */ whereRegex(fieldName: Field<T>, pattern: string): TSelf; /** * Filter matches to be inside the specified radius */ withinRadiusOf(fieldName: Field<T>, radius: number, latitude: number, longitude: number): TSelf; /** * Filter matches to be inside the specified radius */ withinRadiusOf(fieldName: Field<T>, radius: number, latitude: number, longitude: number, radiusUnits: SpatialUnits): TSelf; /** * Filter matches to be inside the specified radius */ withinRadiusOf(fieldName: Field<T>, radius: number, latitude: number, longitude: number, radiusUnits: SpatialUnits, distanceErrorPct: number): TSelf; /** * Filter matches based on a given shape - only documents with the shape defined in fieldName that * have a relation rel with the given shapeWkt will be returned */ relatesToShape(fieldName: Field<T>, shapeWkt: string, relation: SpatialRelation): TSelf; /** * Filter matches based on a given shape - only documents with the shape defined in fieldName that * have a relation rel with the given shapeWkt will be returned */ relatesToShape(fieldName: Field<T>, shapeWkt: string, relation: SpatialRelation, distanceErrorPct: number): TSelf; /** * Filter matches based on a given shape - only documents with the shape defined in fieldName that * have a relation rel with the given shapeWkt will be returned */ relatesToShape(fieldName: Field<T>, shapeWkt: string, relation: SpatialRelation, units: SpatialUnits, distanceErrorPct: number): TSelf; /** * Ability to use one factory to determine spatial shape that will be used in query. */ spatial(fieldName: Field<T>, clause: (spatialCriteriaFactory: SpatialCriteriaFactory) => SpatialCriteria): IDocumentQuery<T>; spatial(field: DynamicSpatialField, clause: (spatialCriteriaFactory: SpatialCriteriaFactory) => SpatialCriteria): IDocumentQuery<T>; moreLikeThis(moreLikeThis: MoreLikeThisBase): IDocumentQuery<T>; } //# sourceMappingURL=IFilterDocumentQueryBase.d.ts.map