Skip to content

Commit

Permalink
added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
guyroyse committed Dec 17, 2021
1 parent 609ec96 commit e681a99
Show file tree
Hide file tree
Showing 19 changed files with 150 additions and 106 deletions.
31 changes: 23 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ redis-om
- [SchemaDefinition](README.md#schemadefinition)
- [SchemaOptions](README.md#schemaoptions)
- [SearchDataStructure](README.md#searchdatastructure)
- [StopWordOptions](README.md#stopwordoptions)
- [SubSearchFunction](README.md#subsearchfunction)

## Type aliases
Expand Down Expand Up @@ -61,7 +62,7 @@ A constructor that creates an [Entity](classes/Entity.md) of type TEntity.

#### Defined in

[lib/entity/entity.ts:10](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/entity/entity.ts#L10)
[lib/entity/entity.ts:10](https://github.com/redis/redis-om-node/blob/609ec96/lib/entity/entity.ts#L10)

___

Expand All @@ -77,7 +78,7 @@ A JavaScript object containing the underlying data of an [Entity](classes/Entity

#### Defined in

[lib/entity/entity.ts:4](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/entity/entity.ts#L4)
[lib/entity/entity.ts:4](https://github.com/redis/redis-om-node/blob/609ec96/lib/entity/entity.ts#L4)

___

Expand All @@ -89,7 +90,7 @@ Contains instructions telling how to map a property on an [Entity](classes/Entit

#### Defined in

[lib/schema/schema-definitions.ts:54](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema-definitions.ts#L54)
[lib/schema/schema-definitions.ts:54](https://github.com/redis/redis-om-node/blob/609ec96/lib/schema/schema-definitions.ts#L54)

___

Expand All @@ -109,7 +110,7 @@ A function that generates random [Entity IDs](classes/Entity.md#entityid).

#### Defined in

[lib/schema/schema-definitions.ts:68](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema-definitions.ts#L68)
[lib/schema/schema-definitions.ts:68](https://github.com/redis/redis-om-node/blob/609ec96/lib/schema/schema-definitions.ts#L68)

___

Expand All @@ -128,7 +129,7 @@ contains a [FieldDefinition](README.md#fielddefinition) that tell Redis OM how t

#### Defined in

[lib/schema/schema-definitions.ts:59](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema-definitions.ts#L59)
[lib/schema/schema-definitions.ts:59](https://github.com/redis/redis-om-node/blob/609ec96/lib/schema/schema-definitions.ts#L59)

___

Expand All @@ -146,10 +147,12 @@ Configuration options for a [Schema](classes/Schema.md).
| `idStrategy?` | [`IdStrategy`](README.md#idstrategy) | A function that generates a random [Entity ID](classes/Entity.md#entityid). Defaults to a function that generates [ULIDs](https://github.com/ulid/spec). 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](classes/Schema.md). 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](classes/Entity.md). Defaults to the class name of the [Entity](classes/Entity.md). 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`](README.md#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`. |

#### Defined in

[lib/schema/schema-options.ts:7](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema-options.ts#L7)
[lib/schema/schema-options.ts:7](https://github.com/redis/redis-om-node/blob/609ec96/lib/schema/schema-options.ts#L7)

___

Expand All @@ -161,7 +164,19 @@ The type of data structure in Redis to map objects to.

#### Defined in

[lib/client.ts:21](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/client.ts#L21)
[lib/client.ts:21](https://github.com/redis/redis-om-node/blob/609ec96/lib/client.ts#L21)

___

### StopWordOptions

Ƭ **StopWordOptions**: ``"OFF"`` \| ``"DEFAULT"`` \| ``"CUSTOM"``

Valid values for how to use stop words for a given [Schema](classes/Schema.md).

#### Defined in

[lib/schema/schema-definitions.ts:71](https://github.com/redis/redis-om-node/blob/609ec96/lib/schema/schema-definitions.ts#L71)

___

Expand Down Expand Up @@ -193,4 +208,4 @@ A function that takes a [Search](classes/Search.md) and returns a [Search](class

#### Defined in

[lib/search/search.ts:21](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/search.ts#L21)
[lib/search/search.ts:22](https://github.com/redis/redis-om-node/blob/609ec96/lib/search/search.ts#L22)
8 changes: 4 additions & 4 deletions docs/classes/Client.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Close the connection to Redis.

#### Defined in

[lib/client.ts:79](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/client.ts#L79)
[lib/client.ts:96](https://github.com/redis/redis-om-node/blob/609ec96/lib/client.ts#L96)

___

Expand Down Expand Up @@ -77,7 +77,7 @@ The raw results of calling the Redis command.

#### Defined in

[lib/client.ts:56](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/client.ts#L56)
[lib/client.ts:73](https://github.com/redis/redis-om-node/blob/609ec96/lib/client.ts#L73)

___

Expand Down Expand Up @@ -107,7 +107,7 @@ A repository for the provided schema.

#### Defined in

[lib/client.ts:71](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/client.ts#L71)
[lib/client.ts:88](https://github.com/redis/redis-om-node/blob/609ec96/lib/client.ts#L88)

___

Expand All @@ -129,4 +129,4 @@ Open a connection to Redis at the provided URL.

#### Defined in

[lib/client.ts:43](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/client.ts#L43)
[lib/client.ts:60](https://github.com/redis/redis-om-node/blob/609ec96/lib/client.ts#L60)
2 changes: 1 addition & 1 deletion docs/classes/Entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ The generated entity ID.

#### Defined in

[lib/entity/entity.ts:22](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/entity/entity.ts#L22)
[lib/entity/entity.ts:22](https://github.com/redis/redis-om-node/blob/609ec96/lib/entity/entity.ts#L22)
8 changes: 4 additions & 4 deletions docs/classes/RedisError.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Error.constructor

#### Defined in

[lib/errors.ts:2](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/errors.ts#L2)
[lib/errors.ts:2](https://github.com/redis/redis-om-node/blob/609ec96/lib/errors.ts#L2)

## Properties

Expand All @@ -58,7 +58,7 @@ Error.message

#### Defined in

node_modules/typescript/lib/lib.es5.d.ts:974
node_modules/typescript/lib/lib.es5.d.ts:1023

___

Expand All @@ -72,7 +72,7 @@ Error.name

#### Defined in

node_modules/typescript/lib/lib.es5.d.ts:973
node_modules/typescript/lib/lib.es5.d.ts:1022

___

Expand All @@ -86,7 +86,7 @@ Error.stack

#### Defined in

node_modules/typescript/lib/lib.es5.d.ts:975
node_modules/typescript/lib/lib.es5.d.ts:1024

___

Expand Down
16 changes: 8 additions & 8 deletions docs/classes/Repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Constructs a new Repository.

#### Defined in

[lib/repository/repository.ts:60](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/repository/repository.ts#L60)
[lib/repository/repository.ts:60](https://github.com/redis/redis-om-node/blob/609ec96/lib/repository/repository.ts#L60)

## Methods

Expand All @@ -100,7 +100,7 @@ A newly created Entity.

#### Defined in

[lib/repository/repository.ts:100](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/repository/repository.ts#L100)
[lib/repository/repository.ts:106](https://github.com/redis/redis-om-node/blob/609ec96/lib/repository/repository.ts#L106)

___

Expand All @@ -117,7 +117,7 @@ that RediSearch or RedisJSON is installed on your instance of Redis.

#### Defined in

[lib/repository/repository.ts:71](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/repository/repository.ts#L71)
[lib/repository/repository.ts:71](https://github.com/redis/redis-om-node/blob/609ec96/lib/repository/repository.ts#L71)

___

Expand All @@ -135,7 +135,7 @@ on your instance of Redis.

#### Defined in

[lib/repository/repository.ts:84](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/repository/repository.ts#L84)
[lib/repository/repository.ts:90](https://github.com/redis/redis-om-node/blob/609ec96/lib/repository/repository.ts#L90)

___

Expand All @@ -161,7 +161,7 @@ The matching Entity.

#### Defined in

[lib/repository/repository.ts:138](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/repository/repository.ts#L138)
[lib/repository/repository.ts:144](https://github.com/redis/redis-om-node/blob/609ec96/lib/repository/repository.ts#L144)

___

Expand All @@ -184,7 +184,7 @@ not found, does nothing.

#### Defined in

[lib/repository/repository.ts:159](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/repository/repository.ts#L159)
[lib/repository/repository.ts:165](https://github.com/redis/redis-om-node/blob/609ec96/lib/repository/repository.ts#L165)

___

Expand All @@ -209,7 +209,7 @@ The ID of the Entity just saved.

#### Defined in

[lib/repository/repository.ts:111](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/repository/repository.ts#L111)
[lib/repository/repository.ts:117](https://github.com/redis/redis-om-node/blob/609ec96/lib/repository/repository.ts#L117)

___

Expand All @@ -228,4 +228,4 @@ A [Search](Search.md) object.

#### Defined in

[lib/repository/repository.ts:170](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/repository/repository.ts#L170)
[lib/repository/repository.ts:176](https://github.com/redis/redis-om-node/blob/609ec96/lib/repository/repository.ts#L176)
47 changes: 42 additions & 5 deletions docs/classes/Schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ its constructor.
- [dataStructure](Schema.md#datastructure)
- [indexName](Schema.md#indexname)
- [prefix](Schema.md#prefix)
- [stopWords](Schema.md#stopwords)
- [useStopWords](Schema.md#usestopwords)

### Methods

Expand Down Expand Up @@ -64,7 +66,7 @@ its constructor.

#### Defined in

[lib/schema/schema.ts:53](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema.ts#L53)
[lib/schema/schema.ts:53](https://github.com/redis/redis-om-node/blob/609ec96/lib/schema/schema.ts#L53)

## Accessors

Expand All @@ -81,7 +83,7 @@ that this Schema uses to store [Entities](Entity.md) in Redis.

#### Defined in

[lib/schema/schema.ts:72](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema.ts#L72)
[lib/schema/schema.ts:72](https://github.com/redis/redis-om-node/blob/609ec96/lib/schema/schema.ts#L72)

___

Expand All @@ -97,7 +99,7 @@ The configured name for the RediSearch index for this Schema.

#### Defined in

[lib/schema/schema.ts:66](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema.ts#L66)
[lib/schema/schema.ts:66](https://github.com/redis/redis-om-node/blob/609ec96/lib/schema/schema.ts#L66)

___

Expand All @@ -113,7 +115,42 @@ The configured keyspace prefix in Redis for this Schema.

#### Defined in

[lib/schema/schema.ts:63](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema.ts#L63)
[lib/schema/schema.ts:63](https://github.com/redis/redis-om-node/blob/609ec96/lib/schema/schema.ts#L63)

___

### stopWords

`get` **stopWords**(): `string`[]

The configured stop words. Ignored if [Schema.useStopWords](Schema.md#usestopwords) is anything other
than `CUSTOM`.

#### Returns

`string`[]

#### Defined in

[lib/schema/schema.ts:85](https://github.com/redis/redis-om-node/blob/609ec96/lib/schema/schema.ts#L85)

___

### useStopWords

`get` **useStopWords**(): [`StopWordOptions`](../README.md#stopwordoptions)

The configured usage of stop words, a string with the value of either `OFF`, `DEFAULT`,
or `CUSTOM`. See {@link SchemaOptions.useStopWords} and {@link SchemaOptions.stopWords}
for more details.

#### Returns

[`StopWordOptions`](../README.md#stopwordoptions)

#### Defined in

[lib/schema/schema.ts:79](https://github.com/redis/redis-om-node/blob/609ec96/lib/schema/schema.ts#L79)

## Methods

Expand All @@ -129,4 +166,4 @@ Generates a unique string using the configured [IdStrategy](../README.md#idstrat

#### Defined in

[lib/schema/schema.ts:81](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema.ts#L81)
[lib/schema/schema.ts:94](https://github.com/redis/redis-om-node/blob/609ec96/lib/schema/schema.ts#L94)
Loading

0 comments on commit e681a99

Please sign in to comment.