redis-om-type 1.0.0

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.
@@ -0,0 +1,1199 @@
1
+ [redis-om](../README.md) / Search
2
+
3
+ # Class: Search
4
+
5
+ Entry point to fluent search. This is the default Redis OM experience.
6
+ Requires that RediSearch (and optionally RedisJSON) be installed.
7
+
8
+ **`Template`**
9
+
10
+ The type of [Entity](../README.md#entity) being sought.
11
+
12
+ ## Hierarchy
13
+
14
+ - [`AbstractSearch`](AbstractSearch.md)
15
+
16
+ ↳ **`Search`**
17
+
18
+ ## Table of contents
19
+
20
+ ### Accessors
21
+
22
+ - [return](Search.md#return)
23
+
24
+ ### Methods
25
+
26
+ - [all](Search.md#all)
27
+ - [allIds](Search.md#allids)
28
+ - [allKeys](Search.md#allkeys)
29
+ - [and](Search.md#and)
30
+ - [count](Search.md#count)
31
+ - [first](Search.md#first)
32
+ - [firstId](Search.md#firstid)
33
+ - [firstKey](Search.md#firstkey)
34
+ - [max](Search.md#max)
35
+ - [maxId](Search.md#maxid)
36
+ - [maxKey](Search.md#maxkey)
37
+ - [min](Search.md#min)
38
+ - [minId](Search.md#minid)
39
+ - [minKey](Search.md#minkey)
40
+ - [or](Search.md#or)
41
+ - [page](Search.md#page)
42
+ - [pageOfIds](Search.md#pageofids)
43
+ - [pageOfKeys](Search.md#pageofkeys)
44
+ - [returnAll](Search.md#returnall)
45
+ - [returnAllIds](Search.md#returnallids)
46
+ - [returnAllKeys](Search.md#returnallkeys)
47
+ - [returnCount](Search.md#returncount)
48
+ - [returnFirst](Search.md#returnfirst)
49
+ - [returnFirstId](Search.md#returnfirstid)
50
+ - [returnFirstKey](Search.md#returnfirstkey)
51
+ - [returnMax](Search.md#returnmax)
52
+ - [returnMaxId](Search.md#returnmaxid)
53
+ - [returnMaxKey](Search.md#returnmaxkey)
54
+ - [returnMin](Search.md#returnmin)
55
+ - [returnMinId](Search.md#returnminid)
56
+ - [returnMinKey](Search.md#returnminkey)
57
+ - [returnPage](Search.md#returnpage)
58
+ - [returnPageOfIds](Search.md#returnpageofids)
59
+ - [returnPageOfKeys](Search.md#returnpageofkeys)
60
+ - [sortAsc](Search.md#sortasc)
61
+ - [sortAscending](Search.md#sortascending)
62
+ - [sortBy](Search.md#sortby)
63
+ - [sortDesc](Search.md#sortdesc)
64
+ - [sortDescending](Search.md#sortdescending)
65
+ - [where](Search.md#where)
66
+
67
+ ## Accessors
68
+
69
+ ### return
70
+
71
+ • `get` **return**(): [`AbstractSearch`](AbstractSearch.md)
72
+
73
+ Returns the current instance. Syntactic sugar to make your code more fluent.
74
+
75
+ #### Returns
76
+
77
+ [`AbstractSearch`](AbstractSearch.md)
78
+
79
+ this
80
+
81
+ #### Inherited from
82
+
83
+ AbstractSearch.return
84
+
85
+ #### Defined in
86
+
87
+ [lib/search/search.ts:308](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L308)
88
+
89
+ ## Methods
90
+
91
+ ### all
92
+
93
+ ▸ **all**(`options?`): `Promise`<[`Entity`](../README.md#entity)[]\>
94
+
95
+ Returns all the [Entities](../README.md#entity) that match this query. This method
96
+ makes multiple calls to Redis until all the [Entities](../README.md#entity) are returned.
97
+ You can specify the batch size by setting the `pageSize` property on the
98
+ options:
99
+
100
+ ```typescript
101
+ const entities = await repository.search().returnAll({ pageSize: 100 })
102
+ ```
103
+
104
+ #### Parameters
105
+
106
+ | Name | Type | Default value | Description |
107
+ | :------ | :------ | :------ | :------ |
108
+ | `options` | `Object` | `undefined` | Options for the call. |
109
+ | `options.pageSize` | `number` | `10` | Number of [Entities](../README.md#entity) returned per batch. |
110
+
111
+ #### Returns
112
+
113
+ `Promise`<[`Entity`](../README.md#entity)[]\>
114
+
115
+ An array of [Entities](../README.md#entity) matching the query.
116
+
117
+ #### Inherited from
118
+
119
+ [AbstractSearch](AbstractSearch.md).[all](AbstractSearch.md#all)
120
+
121
+ #### Defined in
122
+
123
+ [lib/search/search.ts:264](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L264)
124
+
125
+ ___
126
+
127
+ ### allIds
128
+
129
+ ▸ **allIds**(`options?`): `Promise`<`string`[]\>
130
+
131
+ Returns all the entity IDs that match this query. This method
132
+ makes multiple calls to Redis until all the entity IDs are returned.
133
+ You can specify the batch size by setting the `pageSize` property on the
134
+ options:
135
+
136
+ ```typescript
137
+ const keys = await repository.search().returnAllIds({ pageSize: 100 })
138
+ ```
139
+
140
+ #### Parameters
141
+
142
+ | Name | Type | Default value | Description |
143
+ | :------ | :------ | :------ | :------ |
144
+ | `options` | `Object` | `undefined` | Options for the call. |
145
+ | `options.pageSize` | `number` | `10` | Number of entity IDs returned per batch. |
146
+
147
+ #### Returns
148
+
149
+ `Promise`<`string`[]\>
150
+
151
+ An array of entity IDs matching the query.
152
+
153
+ #### Inherited from
154
+
155
+ [AbstractSearch](AbstractSearch.md).[allIds](AbstractSearch.md#allids)
156
+
157
+ #### Defined in
158
+
159
+ [lib/search/search.ts:282](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L282)
160
+
161
+ ___
162
+
163
+ ### allKeys
164
+
165
+ ▸ **allKeys**(`options?`): `Promise`<`string`[]\>
166
+
167
+ Returns all the key names in Redis that match this query. This method
168
+ makes multiple calls to Redis until all the key names are returned.
169
+ You can specify the batch size by setting the `pageSize` property on the
170
+ options:
171
+
172
+ ```typescript
173
+ const keys = await repository.search().returnAllKeys({ pageSize: 100 })
174
+ ```
175
+
176
+ #### Parameters
177
+
178
+ | Name | Type | Default value | Description |
179
+ | :------ | :------ | :------ | :------ |
180
+ | `options` | `Object` | `undefined` | Options for the call. |
181
+ | `options.pageSize` | `number` | `10` | Number of key names returned per batch. |
182
+
183
+ #### Returns
184
+
185
+ `Promise`<`string`[]\>
186
+
187
+ An array of key names matching the query.
188
+
189
+ #### Inherited from
190
+
191
+ [AbstractSearch](AbstractSearch.md).[allKeys](AbstractSearch.md#allkeys)
192
+
193
+ #### Defined in
194
+
195
+ [lib/search/search.ts:300](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L300)
196
+
197
+ ___
198
+
199
+ ### and
200
+
201
+ ▸ **and**(`field`): [`WhereField`](WhereField.md)
202
+
203
+ Sets up a query matching a particular field as a logical AND.
204
+
205
+ #### Parameters
206
+
207
+ | Name | Type | Description |
208
+ | :------ | :------ | :------ |
209
+ | `field` | `string` | The field to filter on. |
210
+
211
+ #### Returns
212
+
213
+ [`WhereField`](WhereField.md)
214
+
215
+ A subclass of [WhereField](WhereField.md) matching the type of the field.
216
+
217
+ #### Defined in
218
+
219
+ [lib/search/search.ts:530](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L530)
220
+
221
+ ▸ **and**(`subSearchFn`): [`Search`](Search.md)
222
+
223
+ Sets up a nested search as a logical AND.
224
+
225
+ #### Parameters
226
+
227
+ | Name | Type | Description |
228
+ | :------ | :------ | :------ |
229
+ | `subSearchFn` | [`SubSearchFunction`](../README.md#subsearchfunction) | A function that takes a [Search](Search.md) and returns another [Search](Search.md). |
230
+
231
+ #### Returns
232
+
233
+ [`Search`](Search.md)
234
+
235
+ `this`.
236
+
237
+ #### Defined in
238
+
239
+ [lib/search/search.ts:537](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L537)
240
+
241
+ ___
242
+
243
+ ### count
244
+
245
+ ▸ **count**(): `Promise`<`number`\>
246
+
247
+ Returns the number of [Entities](../README.md#entity) that match this query.
248
+
249
+ #### Returns
250
+
251
+ `Promise`<`number`\>
252
+
253
+ #### Inherited from
254
+
255
+ [AbstractSearch](AbstractSearch.md).[count](AbstractSearch.md#count)
256
+
257
+ #### Defined in
258
+
259
+ [lib/search/search.ts:188](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L188)
260
+
261
+ ___
262
+
263
+ ### first
264
+
265
+ ▸ **first**(): `Promise`<``null`` \| [`Entity`](../README.md#entity)\>
266
+
267
+ Returns the first [Entity](../README.md#entity) that matches this query.
268
+
269
+ #### Returns
270
+
271
+ `Promise`<``null`` \| [`Entity`](../README.md#entity)\>
272
+
273
+ #### Inherited from
274
+
275
+ [AbstractSearch](AbstractSearch.md).[first](AbstractSearch.md#first)
276
+
277
+ #### Defined in
278
+
279
+ [lib/search/search.ts:229](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L229)
280
+
281
+ ___
282
+
283
+ ### firstId
284
+
285
+ ▸ **firstId**(): `Promise`<``null`` \| `string`\>
286
+
287
+ Returns the first entity ID that matches this query.
288
+
289
+ #### Returns
290
+
291
+ `Promise`<``null`` \| `string`\>
292
+
293
+ #### Inherited from
294
+
295
+ [AbstractSearch](AbstractSearch.md).[firstId](AbstractSearch.md#firstid)
296
+
297
+ #### Defined in
298
+
299
+ [lib/search/search.ts:237](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L237)
300
+
301
+ ___
302
+
303
+ ### firstKey
304
+
305
+ ▸ **firstKey**(): `Promise`<``null`` \| `string`\>
306
+
307
+ Returns the first key name that matches this query.
308
+
309
+ #### Returns
310
+
311
+ `Promise`<``null`` \| `string`\>
312
+
313
+ #### Inherited from
314
+
315
+ [AbstractSearch](AbstractSearch.md).[firstKey](AbstractSearch.md#firstkey)
316
+
317
+ #### Defined in
318
+
319
+ [lib/search/search.ts:245](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L245)
320
+
321
+ ___
322
+
323
+ ### max
324
+
325
+ ▸ **max**(`field`): `Promise`<``null`` \| [`Entity`](../README.md#entity)\>
326
+
327
+ Finds the [Entity](../README.md#entity) with the maximal value for a field.
328
+
329
+ #### Parameters
330
+
331
+ | Name | Type | Description |
332
+ | :------ | :------ | :------ |
333
+ | `field` | `string` | The field with the maximal value. |
334
+
335
+ #### Returns
336
+
337
+ `Promise`<``null`` \| [`Entity`](../README.md#entity)\>
338
+
339
+ The entity ID [Entity](../README.md#entity) with the maximal value
340
+
341
+ #### Inherited from
342
+
343
+ [AbstractSearch](AbstractSearch.md).[max](AbstractSearch.md#max)
344
+
345
+ #### Defined in
346
+
347
+ [lib/search/search.ts:162](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L162)
348
+
349
+ ___
350
+
351
+ ### maxId
352
+
353
+ ▸ **maxId**(`field`): `Promise`<``null`` \| `string`\>
354
+
355
+ Finds the entity ID with the maximal value for a field.
356
+
357
+ #### Parameters
358
+
359
+ | Name | Type | Description |
360
+ | :------ | :------ | :------ |
361
+ | `field` | `string` | The field with the maximal value. |
362
+
363
+ #### Returns
364
+
365
+ `Promise`<``null`` \| `string`\>
366
+
367
+ The entity ID with the maximal value
368
+
369
+ #### Inherited from
370
+
371
+ [AbstractSearch](AbstractSearch.md).[maxId](AbstractSearch.md#maxid)
372
+
373
+ #### Defined in
374
+
375
+ [lib/search/search.ts:171](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L171)
376
+
377
+ ___
378
+
379
+ ### maxKey
380
+
381
+ ▸ **maxKey**(`field`): `Promise`<``null`` \| `string`\>
382
+
383
+ Finds the key name in Redis with the maximal value for a field.
384
+
385
+ #### Parameters
386
+
387
+ | Name | Type | Description |
388
+ | :------ | :------ | :------ |
389
+ | `field` | `string` | The field with the maximal value. |
390
+
391
+ #### Returns
392
+
393
+ `Promise`<``null`` \| `string`\>
394
+
395
+ The key name with the maximal value
396
+
397
+ #### Inherited from
398
+
399
+ [AbstractSearch](AbstractSearch.md).[maxKey](AbstractSearch.md#maxkey)
400
+
401
+ #### Defined in
402
+
403
+ [lib/search/search.ts:180](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L180)
404
+
405
+ ___
406
+
407
+ ### min
408
+
409
+ ▸ **min**(`field`): `Promise`<``null`` \| [`Entity`](../README.md#entity)\>
410
+
411
+ Finds the [Entity](../README.md#entity) with the minimal value for a field.
412
+
413
+ #### Parameters
414
+
415
+ | Name | Type | Description |
416
+ | :------ | :------ | :------ |
417
+ | `field` | `string` | The field with the minimal value. |
418
+
419
+ #### Returns
420
+
421
+ `Promise`<``null`` \| [`Entity`](../README.md#entity)\>
422
+
423
+ The [Entity](../README.md#entity) with the minimal value
424
+
425
+ #### Inherited from
426
+
427
+ [AbstractSearch](AbstractSearch.md).[min](AbstractSearch.md#min)
428
+
429
+ #### Defined in
430
+
431
+ [lib/search/search.ts:135](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L135)
432
+
433
+ ___
434
+
435
+ ### minId
436
+
437
+ ▸ **minId**(`field`): `Promise`<``null`` \| `string`\>
438
+
439
+ Finds the entity ID with the minimal value for a field.
440
+
441
+ #### Parameters
442
+
443
+ | Name | Type | Description |
444
+ | :------ | :------ | :------ |
445
+ | `field` | `string` | The field with the minimal value. |
446
+
447
+ #### Returns
448
+
449
+ `Promise`<``null`` \| `string`\>
450
+
451
+ The entity ID with the minimal value
452
+
453
+ #### Inherited from
454
+
455
+ [AbstractSearch](AbstractSearch.md).[minId](AbstractSearch.md#minid)
456
+
457
+ #### Defined in
458
+
459
+ [lib/search/search.ts:144](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L144)
460
+
461
+ ___
462
+
463
+ ### minKey
464
+
465
+ ▸ **minKey**(`field`): `Promise`<``null`` \| `string`\>
466
+
467
+ Finds the key name in Redis with the minimal value for a field.
468
+
469
+ #### Parameters
470
+
471
+ | Name | Type | Description |
472
+ | :------ | :------ | :------ |
473
+ | `field` | `string` | The field with the minimal value. |
474
+
475
+ #### Returns
476
+
477
+ `Promise`<``null`` \| `string`\>
478
+
479
+ The key name with the minimal value
480
+
481
+ #### Inherited from
482
+
483
+ [AbstractSearch](AbstractSearch.md).[minKey](AbstractSearch.md#minkey)
484
+
485
+ #### Defined in
486
+
487
+ [lib/search/search.ts:153](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L153)
488
+
489
+ ___
490
+
491
+ ### or
492
+
493
+ ▸ **or**(`field`): [`WhereField`](WhereField.md)
494
+
495
+ Sets up a query matching a particular field as a logical OR.
496
+
497
+ #### Parameters
498
+
499
+ | Name | Type | Description |
500
+ | :------ | :------ | :------ |
501
+ | `field` | `string` | The field to filter on. |
502
+
503
+ #### Returns
504
+
505
+ [`WhereField`](WhereField.md)
506
+
507
+ A subclass of [WhereField](WhereField.md) matching the type of the field.
508
+
509
+ #### Defined in
510
+
511
+ [lib/search/search.ts:547](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L547)
512
+
513
+ ▸ **or**(`subSearchFn`): [`Search`](Search.md)
514
+
515
+ Sets up a nested search as a logical OR.
516
+
517
+ #### Parameters
518
+
519
+ | Name | Type | Description |
520
+ | :------ | :------ | :------ |
521
+ | `subSearchFn` | [`SubSearchFunction`](../README.md#subsearchfunction) | A function that takes a [Search](Search.md) and returns another [Search](Search.md). |
522
+
523
+ #### Returns
524
+
525
+ [`Search`](Search.md)
526
+
527
+ `this`.
528
+
529
+ #### Defined in
530
+
531
+ [lib/search/search.ts:554](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L554)
532
+
533
+ ___
534
+
535
+ ### page
536
+
537
+ ▸ **page**(`offset`, `count`): `Promise`<[`Entity`](../README.md#entity)[]\>
538
+
539
+ Returns a page of [Entities](../README.md#entity) that match this query.
540
+
541
+ #### Parameters
542
+
543
+ | Name | Type | Description |
544
+ | :------ | :------ | :------ |
545
+ | `offset` | `number` | The offset for where to start returning [Entities](../README.md#entity). |
546
+ | `count` | `number` | The number of [Entities](../README.md#entity) to return. |
547
+
548
+ #### Returns
549
+
550
+ `Promise`<[`Entity`](../README.md#entity)[]\>
551
+
552
+ An array of [Entities](../README.md#entity) matching the query.
553
+
554
+ #### Inherited from
555
+
556
+ [AbstractSearch](AbstractSearch.md).[page](AbstractSearch.md#page)
557
+
558
+ #### Defined in
559
+
560
+ [lib/search/search.ts:199](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L199)
561
+
562
+ ___
563
+
564
+ ### pageOfIds
565
+
566
+ ▸ **pageOfIds**(`offset`, `count`): `Promise`<`string`[]\>
567
+
568
+ Returns a page of entity IDs that match this query.
569
+
570
+ #### Parameters
571
+
572
+ | Name | Type | Description |
573
+ | :------ | :------ | :------ |
574
+ | `offset` | `number` | The offset for where to start returning entity IDs. |
575
+ | `count` | `number` | The number of entity IDs to return. |
576
+
577
+ #### Returns
578
+
579
+ `Promise`<`string`[]\>
580
+
581
+ An array of strings matching the query.
582
+
583
+ #### Inherited from
584
+
585
+ [AbstractSearch](AbstractSearch.md).[pageOfIds](AbstractSearch.md#pageofids)
586
+
587
+ #### Defined in
588
+
589
+ [lib/search/search.ts:210](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L210)
590
+
591
+ ___
592
+
593
+ ### pageOfKeys
594
+
595
+ ▸ **pageOfKeys**(`offset`, `count`): `Promise`<`string`[]\>
596
+
597
+ Returns a page of key names in Redis that match this query.
598
+
599
+ #### Parameters
600
+
601
+ | Name | Type | Description |
602
+ | :------ | :------ | :------ |
603
+ | `offset` | `number` | The offset for where to start returning key names. |
604
+ | `count` | `number` | The number of key names to return. |
605
+
606
+ #### Returns
607
+
608
+ `Promise`<`string`[]\>
609
+
610
+ An array of strings matching the query.
611
+
612
+ #### Inherited from
613
+
614
+ [AbstractSearch](AbstractSearch.md).[pageOfKeys](AbstractSearch.md#pageofkeys)
615
+
616
+ #### Defined in
617
+
618
+ [lib/search/search.ts:221](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L221)
619
+
620
+ ___
621
+
622
+ ### returnAll
623
+
624
+ ▸ **returnAll**(`options?`): `Promise`<[`Entity`](../README.md#entity)[]\>
625
+
626
+ Alias for [all](Search.md#all).
627
+
628
+ #### Parameters
629
+
630
+ | Name | Type | Default value |
631
+ | :------ | :------ | :------ |
632
+ | `options` | `Object` | `undefined` |
633
+ | `options.pageSize` | `number` | `10` |
634
+
635
+ #### Returns
636
+
637
+ `Promise`<[`Entity`](../README.md#entity)[]\>
638
+
639
+ #### Inherited from
640
+
641
+ [AbstractSearch](AbstractSearch.md).[returnAll](AbstractSearch.md#returnall)
642
+
643
+ #### Defined in
644
+
645
+ [lib/search/search.ts:406](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L406)
646
+
647
+ ___
648
+
649
+ ### returnAllIds
650
+
651
+ ▸ **returnAllIds**(`options?`): `Promise`<`string`[]\>
652
+
653
+ Alias for [allIds](Search.md#allids).
654
+
655
+ #### Parameters
656
+
657
+ | Name | Type | Default value |
658
+ | :------ | :------ | :------ |
659
+ | `options` | `Object` | `undefined` |
660
+ | `options.pageSize` | `number` | `10` |
661
+
662
+ #### Returns
663
+
664
+ `Promise`<`string`[]\>
665
+
666
+ #### Inherited from
667
+
668
+ [AbstractSearch](AbstractSearch.md).[returnAllIds](AbstractSearch.md#returnallids)
669
+
670
+ #### Defined in
671
+
672
+ [lib/search/search.ts:413](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L413)
673
+
674
+ ___
675
+
676
+ ### returnAllKeys
677
+
678
+ ▸ **returnAllKeys**(`options?`): `Promise`<`string`[]\>
679
+
680
+ Alias for [allKeys](Search.md#allkeys).
681
+
682
+ #### Parameters
683
+
684
+ | Name | Type | Default value |
685
+ | :------ | :------ | :------ |
686
+ | `options` | `Object` | `undefined` |
687
+ | `options.pageSize` | `number` | `10` |
688
+
689
+ #### Returns
690
+
691
+ `Promise`<`string`[]\>
692
+
693
+ #### Inherited from
694
+
695
+ [AbstractSearch](AbstractSearch.md).[returnAllKeys](AbstractSearch.md#returnallkeys)
696
+
697
+ #### Defined in
698
+
699
+ [lib/search/search.ts:420](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L420)
700
+
701
+ ___
702
+
703
+ ### returnCount
704
+
705
+ ▸ **returnCount**(): `Promise`<`number`\>
706
+
707
+ Alias for [count](Search.md#count).
708
+
709
+ #### Returns
710
+
711
+ `Promise`<`number`\>
712
+
713
+ #### Inherited from
714
+
715
+ [AbstractSearch](AbstractSearch.md).[returnCount](AbstractSearch.md#returncount)
716
+
717
+ #### Defined in
718
+
719
+ [lib/search/search.ts:357](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L357)
720
+
721
+ ___
722
+
723
+ ### returnFirst
724
+
725
+ ▸ **returnFirst**(): `Promise`<``null`` \| [`Entity`](../README.md#entity)\>
726
+
727
+ Alias for [first](Search.md#first).
728
+
729
+ #### Returns
730
+
731
+ `Promise`<``null`` \| [`Entity`](../README.md#entity)\>
732
+
733
+ #### Inherited from
734
+
735
+ [AbstractSearch](AbstractSearch.md).[returnFirst](AbstractSearch.md#returnfirst)
736
+
737
+ #### Defined in
738
+
739
+ [lib/search/search.ts:385](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L385)
740
+
741
+ ___
742
+
743
+ ### returnFirstId
744
+
745
+ ▸ **returnFirstId**(): `Promise`<``null`` \| `string`\>
746
+
747
+ Alias for [firstId](Search.md#firstid).
748
+
749
+ #### Returns
750
+
751
+ `Promise`<``null`` \| `string`\>
752
+
753
+ #### Inherited from
754
+
755
+ [AbstractSearch](AbstractSearch.md).[returnFirstId](AbstractSearch.md#returnfirstid)
756
+
757
+ #### Defined in
758
+
759
+ [lib/search/search.ts:392](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L392)
760
+
761
+ ___
762
+
763
+ ### returnFirstKey
764
+
765
+ ▸ **returnFirstKey**(): `Promise`<``null`` \| `string`\>
766
+
767
+ Alias for [firstKey](Search.md#firstkey).
768
+
769
+ #### Returns
770
+
771
+ `Promise`<``null`` \| `string`\>
772
+
773
+ #### Inherited from
774
+
775
+ [AbstractSearch](AbstractSearch.md).[returnFirstKey](AbstractSearch.md#returnfirstkey)
776
+
777
+ #### Defined in
778
+
779
+ [lib/search/search.ts:399](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L399)
780
+
781
+ ___
782
+
783
+ ### returnMax
784
+
785
+ ▸ **returnMax**(`field`): `Promise`<``null`` \| [`Entity`](../README.md#entity)\>
786
+
787
+ Alias for [max](Search.md#max).
788
+
789
+ #### Parameters
790
+
791
+ | Name | Type |
792
+ | :------ | :------ |
793
+ | `field` | `string` |
794
+
795
+ #### Returns
796
+
797
+ `Promise`<``null`` \| [`Entity`](../README.md#entity)\>
798
+
799
+ #### Inherited from
800
+
801
+ [AbstractSearch](AbstractSearch.md).[returnMax](AbstractSearch.md#returnmax)
802
+
803
+ #### Defined in
804
+
805
+ [lib/search/search.ts:336](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L336)
806
+
807
+ ___
808
+
809
+ ### returnMaxId
810
+
811
+ ▸ **returnMaxId**(`field`): `Promise`<``null`` \| `string`\>
812
+
813
+ Alias for [maxId](Search.md#maxid).
814
+
815
+ #### Parameters
816
+
817
+ | Name | Type |
818
+ | :------ | :------ |
819
+ | `field` | `string` |
820
+
821
+ #### Returns
822
+
823
+ `Promise`<``null`` \| `string`\>
824
+
825
+ #### Inherited from
826
+
827
+ [AbstractSearch](AbstractSearch.md).[returnMaxId](AbstractSearch.md#returnmaxid)
828
+
829
+ #### Defined in
830
+
831
+ [lib/search/search.ts:343](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L343)
832
+
833
+ ___
834
+
835
+ ### returnMaxKey
836
+
837
+ ▸ **returnMaxKey**(`field`): `Promise`<``null`` \| `string`\>
838
+
839
+ Alias for [maxKey](Search.md#maxkey).
840
+
841
+ #### Parameters
842
+
843
+ | Name | Type |
844
+ | :------ | :------ |
845
+ | `field` | `string` |
846
+
847
+ #### Returns
848
+
849
+ `Promise`<``null`` \| `string`\>
850
+
851
+ #### Inherited from
852
+
853
+ [AbstractSearch](AbstractSearch.md).[returnMaxKey](AbstractSearch.md#returnmaxkey)
854
+
855
+ #### Defined in
856
+
857
+ [lib/search/search.ts:350](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L350)
858
+
859
+ ___
860
+
861
+ ### returnMin
862
+
863
+ ▸ **returnMin**(`field`): `Promise`<``null`` \| [`Entity`](../README.md#entity)\>
864
+
865
+ Alias for [min](Search.md#min).
866
+
867
+ #### Parameters
868
+
869
+ | Name | Type |
870
+ | :------ | :------ |
871
+ | `field` | `string` |
872
+
873
+ #### Returns
874
+
875
+ `Promise`<``null`` \| [`Entity`](../README.md#entity)\>
876
+
877
+ #### Inherited from
878
+
879
+ [AbstractSearch](AbstractSearch.md).[returnMin](AbstractSearch.md#returnmin)
880
+
881
+ #### Defined in
882
+
883
+ [lib/search/search.ts:315](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L315)
884
+
885
+ ___
886
+
887
+ ### returnMinId
888
+
889
+ ▸ **returnMinId**(`field`): `Promise`<``null`` \| `string`\>
890
+
891
+ Alias for [minId](Search.md#minid).
892
+
893
+ #### Parameters
894
+
895
+ | Name | Type |
896
+ | :------ | :------ |
897
+ | `field` | `string` |
898
+
899
+ #### Returns
900
+
901
+ `Promise`<``null`` \| `string`\>
902
+
903
+ #### Inherited from
904
+
905
+ [AbstractSearch](AbstractSearch.md).[returnMinId](AbstractSearch.md#returnminid)
906
+
907
+ #### Defined in
908
+
909
+ [lib/search/search.ts:322](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L322)
910
+
911
+ ___
912
+
913
+ ### returnMinKey
914
+
915
+ ▸ **returnMinKey**(`field`): `Promise`<``null`` \| `string`\>
916
+
917
+ Alias for [minKey](Search.md#minkey).
918
+
919
+ #### Parameters
920
+
921
+ | Name | Type |
922
+ | :------ | :------ |
923
+ | `field` | `string` |
924
+
925
+ #### Returns
926
+
927
+ `Promise`<``null`` \| `string`\>
928
+
929
+ #### Inherited from
930
+
931
+ [AbstractSearch](AbstractSearch.md).[returnMinKey](AbstractSearch.md#returnminkey)
932
+
933
+ #### Defined in
934
+
935
+ [lib/search/search.ts:329](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L329)
936
+
937
+ ___
938
+
939
+ ### returnPage
940
+
941
+ ▸ **returnPage**(`offset`, `count`): `Promise`<[`Entity`](../README.md#entity)[]\>
942
+
943
+ Alias for [page](Search.md#page).
944
+
945
+ #### Parameters
946
+
947
+ | Name | Type |
948
+ | :------ | :------ |
949
+ | `offset` | `number` |
950
+ | `count` | `number` |
951
+
952
+ #### Returns
953
+
954
+ `Promise`<[`Entity`](../README.md#entity)[]\>
955
+
956
+ #### Inherited from
957
+
958
+ [AbstractSearch](AbstractSearch.md).[returnPage](AbstractSearch.md#returnpage)
959
+
960
+ #### Defined in
961
+
962
+ [lib/search/search.ts:364](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L364)
963
+
964
+ ___
965
+
966
+ ### returnPageOfIds
967
+
968
+ ▸ **returnPageOfIds**(`offset`, `count`): `Promise`<`string`[]\>
969
+
970
+ Alias for [pageOfIds](Search.md#pageofids).
971
+
972
+ #### Parameters
973
+
974
+ | Name | Type |
975
+ | :------ | :------ |
976
+ | `offset` | `number` |
977
+ | `count` | `number` |
978
+
979
+ #### Returns
980
+
981
+ `Promise`<`string`[]\>
982
+
983
+ #### Inherited from
984
+
985
+ [AbstractSearch](AbstractSearch.md).[returnPageOfIds](AbstractSearch.md#returnpageofids)
986
+
987
+ #### Defined in
988
+
989
+ [lib/search/search.ts:371](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L371)
990
+
991
+ ___
992
+
993
+ ### returnPageOfKeys
994
+
995
+ ▸ **returnPageOfKeys**(`offset`, `count`): `Promise`<`string`[]\>
996
+
997
+ Alias for [pageOfKeys](Search.md#pageofkeys).
998
+
999
+ #### Parameters
1000
+
1001
+ | Name | Type |
1002
+ | :------ | :------ |
1003
+ | `offset` | `number` |
1004
+ | `count` | `number` |
1005
+
1006
+ #### Returns
1007
+
1008
+ `Promise`<`string`[]\>
1009
+
1010
+ #### Inherited from
1011
+
1012
+ [AbstractSearch](AbstractSearch.md).[returnPageOfKeys](AbstractSearch.md#returnpageofkeys)
1013
+
1014
+ #### Defined in
1015
+
1016
+ [lib/search/search.ts:378](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L378)
1017
+
1018
+ ___
1019
+
1020
+ ### sortAsc
1021
+
1022
+ ▸ **sortAsc**(`field`): [`AbstractSearch`](AbstractSearch.md)
1023
+
1024
+ Alias for [sortAscending](Search.md#sortascending).
1025
+
1026
+ #### Parameters
1027
+
1028
+ | Name | Type |
1029
+ | :------ | :------ |
1030
+ | `field` | `string` |
1031
+
1032
+ #### Returns
1033
+
1034
+ [`AbstractSearch`](AbstractSearch.md)
1035
+
1036
+ #### Inherited from
1037
+
1038
+ [AbstractSearch](AbstractSearch.md).[sortAsc](AbstractSearch.md#sortasc)
1039
+
1040
+ #### Defined in
1041
+
1042
+ [lib/search/search.ts:86](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L86)
1043
+
1044
+ ___
1045
+
1046
+ ### sortAscending
1047
+
1048
+ ▸ **sortAscending**(`field`): [`AbstractSearch`](AbstractSearch.md)
1049
+
1050
+ Applies an ascending sort to the query.
1051
+
1052
+ #### Parameters
1053
+
1054
+ | Name | Type | Description |
1055
+ | :------ | :------ | :------ |
1056
+ | `field` | `string` | The field to sort by. |
1057
+
1058
+ #### Returns
1059
+
1060
+ [`AbstractSearch`](AbstractSearch.md)
1061
+
1062
+ this
1063
+
1064
+ #### Inherited from
1065
+
1066
+ [AbstractSearch](AbstractSearch.md).[sortAscending](AbstractSearch.md#sortascending)
1067
+
1068
+ #### Defined in
1069
+
1070
+ [lib/search/search.ts:63](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L63)
1071
+
1072
+ ___
1073
+
1074
+ ### sortBy
1075
+
1076
+ ▸ **sortBy**(`fieldName`, `order?`): [`AbstractSearch`](AbstractSearch.md)
1077
+
1078
+ Applies sorting for the query.
1079
+
1080
+ #### Parameters
1081
+
1082
+ | Name | Type | Default value | Description |
1083
+ | :------ | :------ | :------ | :------ |
1084
+ | `fieldName` | `string` | `undefined` | - |
1085
+ | `order` | ``"ASC"`` \| ``"DESC"`` | `'ASC'` | The order of returned [Entities](../README.md#entity) Defaults to `ASC` (ascending) if not specified |
1086
+
1087
+ #### Returns
1088
+
1089
+ [`AbstractSearch`](AbstractSearch.md)
1090
+
1091
+ this
1092
+
1093
+ #### Inherited from
1094
+
1095
+ [AbstractSearch](AbstractSearch.md).[sortBy](AbstractSearch.md#sortby)
1096
+
1097
+ #### Defined in
1098
+
1099
+ [lib/search/search.ts:96](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L96)
1100
+
1101
+ ___
1102
+
1103
+ ### sortDesc
1104
+
1105
+ ▸ **sortDesc**(`field`): [`AbstractSearch`](AbstractSearch.md)
1106
+
1107
+ Alias for [sortDescending](Search.md#sortdescending).
1108
+
1109
+ #### Parameters
1110
+
1111
+ | Name | Type |
1112
+ | :------ | :------ |
1113
+ | `field` | `string` |
1114
+
1115
+ #### Returns
1116
+
1117
+ [`AbstractSearch`](AbstractSearch.md)
1118
+
1119
+ #### Inherited from
1120
+
1121
+ [AbstractSearch](AbstractSearch.md).[sortDesc](AbstractSearch.md#sortdesc)
1122
+
1123
+ #### Defined in
1124
+
1125
+ [lib/search/search.ts:70](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L70)
1126
+
1127
+ ___
1128
+
1129
+ ### sortDescending
1130
+
1131
+ ▸ **sortDescending**(`field`): [`AbstractSearch`](AbstractSearch.md)
1132
+
1133
+ Applies a descending sort to the query.
1134
+
1135
+ #### Parameters
1136
+
1137
+ | Name | Type | Description |
1138
+ | :------ | :------ | :------ |
1139
+ | `field` | `string` | The field to sort by. |
1140
+
1141
+ #### Returns
1142
+
1143
+ [`AbstractSearch`](AbstractSearch.md)
1144
+
1145
+ this
1146
+
1147
+ #### Inherited from
1148
+
1149
+ [AbstractSearch](AbstractSearch.md).[sortDescending](AbstractSearch.md#sortdescending)
1150
+
1151
+ #### Defined in
1152
+
1153
+ [lib/search/search.ts:79](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L79)
1154
+
1155
+ ___
1156
+
1157
+ ### where
1158
+
1159
+ ▸ **where**(`field`): [`WhereField`](WhereField.md)
1160
+
1161
+ Sets up a query matching a particular field. If there are multiple calls
1162
+ to [where](Search.md#where), they are treated logically as AND.
1163
+
1164
+ #### Parameters
1165
+
1166
+ | Name | Type | Description |
1167
+ | :------ | :------ | :------ |
1168
+ | `field` | `string` | The field to filter on. |
1169
+
1170
+ #### Returns
1171
+
1172
+ [`WhereField`](WhereField.md)
1173
+
1174
+ A subclass of [WhereField](WhereField.md) matching the type of the field.
1175
+
1176
+ #### Defined in
1177
+
1178
+ [lib/search/search.ts:512](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L512)
1179
+
1180
+ ▸ **where**(`subSearchFn`): [`Search`](Search.md)
1181
+
1182
+ Sets up a nested search. If there are multiple calls to [where](Search.md#where),
1183
+ they are treated logically as AND.
1184
+
1185
+ #### Parameters
1186
+
1187
+ | Name | Type | Description |
1188
+ | :------ | :------ | :------ |
1189
+ | `subSearchFn` | [`SubSearchFunction`](../README.md#subsearchfunction) | A function that takes a [Search](Search.md) and returns another [Search](Search.md). |
1190
+
1191
+ #### Returns
1192
+
1193
+ [`Search`](Search.md)
1194
+
1195
+ `this`.
1196
+
1197
+ #### Defined in
1198
+
1199
+ [lib/search/search.ts:520](https://github.com/redis/redis-om-node/blob/d8438f7/lib/search/search.ts#L520)