redis-om
- EntityConstructor
- EntityData
- FieldDefinition
- IdStrategy
- SchemaDefinition
- SchemaOptions
- SearchDataStructure
- SubSearchFunction
Ƭ EntityConstructor<TEntity
>: (id
: string
, data?
: EntityData
) => TEntity
Name | Description |
---|---|
TEntity |
The Entity type. |
• (id
, data?
)
A constructor that creates an Entity of type TEntity.
Name | Type |
---|---|
id |
string |
data? |
EntityData |
Ƭ EntityData: Object
A JavaScript object containing the underlying data of an Entity.
▪ [key: string
]: string
| number
| boolean
| string
[]
Ƭ FieldDefinition: NumericField
| StringField
| BooleanField
| ArrayField
Contains instructions telling how to map a property on an Entity to Redis.
lib/schema/schema-definitions.ts:54
Ƭ IdStrategy: () => string
▸ (): string
A function that generates random Entity IDs.
string
lib/schema/schema-definitions.ts:68
Ƭ SchemaDefinition: Object
Group of FieldDefinitions that define the schema for an Entity.
▪ [key: string
]: FieldDefinition
The key determines the propery name that is added to the Entity. The property contains a FieldDefinition that tell Redis OM how to map the property to Redis.
lib/schema/schema-definitions.ts:59
Ƭ SchemaOptions: Object
Configuration options for a Schema.
Name | Type | Description |
---|---|---|
dataStructure? |
SearchDataStructure |
The data structure used to store the Entity in Redis. |
idStrategy? |
IdStrategy |
A function that generates a random Entity ID. Defaults to a function that generates ULIDs. Combined with prefix to generate a Redis key. If prefix is Foo and idStratgey returns 12345 then the generated key would be Foo:12345 . |
indexName? |
string |
The name used by RediSearch to store the index for this Schema. Defaults to prefix followed by :index . So, for a prefix of Foo , it would use Foo:index . |
prefix? |
string |
The string that comes before the ID when creating Redis keys for Entities. Defaults to the class name of the Entity. Combined with the results of idStrategy to generate a key. If prefix is Foo and idStrategy returns 12345 then the generated key would be Foo:12345 . |
lib/schema/schema-options.ts:7
Ƭ SearchDataStructure: "HASH"
| "JSON"
The type of data structure in Redis to map objects to.
Ƭ SubSearchFunction<TEntity
>: (search
: Search
<TEntity
>) => Search
<TEntity
>
Name | Type | Description |
---|---|---|
TEntity |
extends Entity |
The type of Entity being sought. |
▸ (search
): Search
<TEntity
>
A function that takes a Search and returns a Search. Used in nested queries.
Name | Type |
---|---|
search |
Search <TEntity > |
Search
<TEntity
>