redis-om
- EntityConstructor
- EntityCreationData
- EntityData
- FieldDefinition
- IdStrategy
- SchemaDefinition
- SchemaOptions
- SearchDataStructure
- StopWordOptions
- SubSearchFunction
Ƭ EntityConstructor<TEntity
>: (schemaDef
: SchemaDefinition
, id
: string
, data?
: EntityData
) => TEntity
Name | Description |
---|---|
TEntity |
The Entity type. |
• (schemaDef
, id
, data?
)
A constructor that creates an Entity of type TEntity.
Name | Type |
---|---|
schemaDef |
SchemaDefinition |
id |
string |
data? |
EntityData |
Ƭ EntityCreationData: Record
<string
, number
| boolean
| string
| string
[] | null
>
Initialization data for Entity creation when calling Repository.createEntity or Repository.createAndSave.
lib/repository/repository.ts:14
Ƭ EntityData: Record
<string
, number
| boolean
| string
| string
[]>
A JavaScript object containing the underlying data of an Entity.
Ƭ 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:62
Ƭ SchemaDefinition: Record
<string
, FieldDefinition
>
Group of FieldDefinitions that define the schema for an Entity.
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 . |
stopWords? |
string [] |
Stop words to be used by this schema. If useStopWords is anything other than CUSTOM , this option is ignored. |
useStopWords? |
StopWordOptions |
Configures the usage of stop words. Valid values are OFF , DEFAULT , and CUSTOM . Setting this to OFF disables all stop words. Setting this to DEFAULT uses the stop words intrinsic to RediSearch. Setting this to CUSTOM tells RediSearch to use the stop words in stopWords . |
lib/schema/schema-options.ts:7
Ƭ SearchDataStructure: "HASH"
| "JSON"
The type of data structure in Redis to map objects to.
Ƭ StopWordOptions: "OFF"
| "DEFAULT"
| "CUSTOM"
Valid values for how to use stop words for a given Schema.
lib/schema/schema-definitions.ts:65
Ƭ 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
>