File tree 1 file changed +24
-2
lines changed
1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -147,14 +147,35 @@ collection NFT {
147
147
```
148
148
149
149
150
- ### Multiple filters
150
+ ### Multiple filters on different fields
151
151
152
- In order to use multiple where or sorts , you must specify the corresponding index.
152
+ In order to use multiple ` where ` or ` sort ` clauses , you must specify the corresponding indexes in your schema.
153
153
154
154
<Snippet file = " indexes/multi-field-index.mdx" />
155
155
156
156
157
157
158
+ ### Multiple filters on the same field (starts with)
159
+
160
+ Multiple ` where ` clauses on the same field can only be applied for greater than/less than combinations (e.g. ` > ` or ` >= ` and ` < ` or ` <= ` ).
161
+
162
+ Using the ` >= ` and ` < ` operators, you can filter records that start with a given prefix.
163
+
164
+ ``` js
165
+ import { Polybase } from " @polybase/client"
166
+
167
+ const db = new Polybase ({ defaultNamespace: " your-namespace" });
168
+ const collectionReference = db .collection (" cities" );
169
+
170
+
171
+ // Starts with UK
172
+ const startsWithUK = await collectionReference
173
+ .where (" country" , " >=" , " UK" )
174
+ .where (" country" , " <" , " UK~" )
175
+ .get ();
176
+ ```
177
+
178
+
158
179
## Listen for updates on a collection
159
180
160
181
``` js
@@ -188,6 +209,7 @@ const collectionReference = db
188
209
);
189
210
```
190
211
212
+
191
213
## Pagination
192
214
193
215
You can paginate through your results using the cursor returned from the
You can’t perform that action at this time.
0 commit comments