$in operator matches documents where the field value equals any one of the specified values.
This is useful when you want to filter by multiple acceptable values without writing separate conditions.
The operator takes an array of values and returns documents where the field matches at least one value in the array.
This is equivalent to combining multiple $eq conditions with a logical OR.
Compatibility
| Field Type | Supported |
|---|---|
| TEXT | Yes |
| U64/I64/F64 | Yes |
| DATE | Yes |
| BOOL | Yes |
Examples
- TypeScript
- Redis CLI