@squidcloud/client 1.0.39 → 1.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -71,6 +71,24 @@ export declare class SimpleQueryBuilder<MyDocType extends DocumentData> {
71
71
  * @returns The query builder.
72
72
  */
73
73
  lte(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
74
+ /**
75
+ * A shortcut for where(fieldName, 'like', pattern).
76
+ *
77
+ * @param fieldName The name of the field to query.
78
+ * @param pattern The pattern to compare against. '%' is the only allowed wildcard
79
+ * @param caseSensitive Whether to use case-sensitive comparison.
80
+ * @returns The query builder.
81
+ */
82
+ like(fieldName: (keyof MyDocType & FieldName) | string, pattern: string, caseSensitive?: boolean): this;
83
+ /**
84
+ * A shortcut for where(fieldName, 'not like', pattern).
85
+ *
86
+ * @param fieldName The name of the field to query.
87
+ * @param pattern The pattern to compare against. '%' is the only allowed wildcard
88
+ * @param caseSensitive Whether to use case-sensitive comparison.
89
+ * @returns The query builder.
90
+ */
91
+ notLike(fieldName: (keyof MyDocType & FieldName) | string, pattern: string, caseSensitive?: boolean): this;
74
92
  /**
75
93
  * Sets a limit to the number of results returned by the query. The maximum limit is 20,000 and the default is 1,000
76
94
  * if none is provided.
@@ -7,7 +7,7 @@ export interface Condition<Doc = any, F extends FieldName<Doc> = any> {
7
7
  operator: Operator;
8
8
  value: Doc[F] | null;
9
9
  }
10
- export type Operator = '==' | '>=' | '<=' | '>' | '<' | '!=';
10
+ export type Operator = '==' | '>=' | '<=' | '>' | '<' | '!=' | 'like' | 'not like' | 'like_cs' | 'not like_cs';
11
11
  export type ContextConditions<Doc = any, F extends FieldName<Doc> = any> = Array<ContextCondition<Doc, F>>;
12
12
  export type GenericValue<Doc = any, F extends FieldName<Doc> = any, O extends AllOperators = any> = O extends 'in' ? Array<Doc[F]> | null : O extends 'not in' ? Array<Doc[F]> | null : Doc[F] | null;
13
13
  export type ContextCondition<Doc = any, F extends FieldName<Doc> = any> = InContextCondition<Doc, F> | NotInContextCondition<Doc, F> | OtherContextCondition<Doc, F>;