Socket
Socket
Sign inDemoInstall

redis-om

Package Overview
Dependencies
7
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.3 to 0.1.4

CHANGELOG

17

dist/client.d.ts

@@ -11,2 +11,15 @@ import Entity from './entity/entity';

export declare type SearchDataStructure = 'HASH' | 'JSON';
export declare type CreateIndexOptions = {
indexName: string;
dataStructure: SearchDataStructure;
prefix: string;
schema: string[];
stopWords?: string[];
};
export declare type SearchOptions = {
indexName: string;
query: string;
offset: number;
count: number;
};
export default class Client {

@@ -18,5 +31,5 @@ private shim?;

close(): Promise<void>;
createIndex(indexName: string, dataStructure: SearchDataStructure, prefix: string, schema: string[]): Promise<void>;
createIndex(options: CreateIndexOptions): Promise<void>;
dropIndex(indexName: string): Promise<void>;
search(indexName: string, query: string, offset: number, count: number): Promise<any[]>;
search(options: SearchOptions): Promise<any[]>;
unlink(key: string): Promise<void>;

@@ -23,0 +36,0 @@ hgetall(key: string): Promise<HashData>;

22

dist/client.js

@@ -35,10 +35,14 @@ "use strict";

}
async createIndex(indexName, dataStructure, prefix, schema) {
async createIndex(options) {
this.validateShimOpen();
await this.shim.execute([
let { indexName, dataStructure, prefix, schema, stopWords } = options;
let command = [
'FT.CREATE', indexName,
'ON', dataStructure,
'PREFIX', '1', `${prefix}`,
'SCHEMA', ...schema
]);
'PREFIX', '1', `${prefix}`
];
if (stopWords !== undefined)
command.push('STOPWORDS', `${stopWords.length}`, ...stopWords);
command.push('SCHEMA', ...schema);
await this.shim.execute(command);
}

@@ -49,5 +53,9 @@ async dropIndex(indexName) {

}
async search(indexName, query, offset, count) {
async search(options) {
this.validateShimOpen();
return await this.shim.execute(['FT.SEARCH', indexName, query, 'LIMIT', offset.toString(), count.toString()]);
let { indexName, query, offset, count } = options;
return await this.shim.execute([
'FT.SEARCH', indexName, query,
'LIMIT', offset.toString(), count.toString()
]);
}

@@ -54,0 +62,0 @@ async unlink(key) {

@@ -6,3 +6,3 @@ import Client, { SearchDataStructure, HashData, JsonData } from "./client";

import Schema from "./schema/schema";
import { SchemaDefinition, FieldDefinition, Field, NumericField, StringField, BooleanField, ArrayField, IdStrategy } from "./schema/schema-definitions";
import { SchemaDefinition, FieldDefinition, Field, NumericField, StringField, BooleanField, ArrayField, IdStrategy, StopWordOptions } from "./schema/schema-definitions";
import { SchemaOptions } from "./schema/schema-options";

@@ -12,2 +12,2 @@ import Search, { SubSearchFunction } from "./search/search";

import WhereField from "./search/where-field";
export { Client, SearchDataStructure, HashData, JsonData, Entity, EntityConstructor, EntityData, RedisError, Repository, Schema, SchemaDefinition, SchemaOptions, FieldDefinition, Field, NumericField, StringField, BooleanField, ArrayField, IdStrategy, Search, SubSearchFunction, Where, WhereField, };
export { Client, SearchDataStructure, HashData, JsonData, Entity, EntityConstructor, EntityData, RedisError, Repository, Schema, SchemaDefinition, SchemaOptions, FieldDefinition, Field, NumericField, StringField, BooleanField, ArrayField, IdStrategy, StopWordOptions, Search, SubSearchFunction, Where, WhereField };

@@ -17,3 +17,13 @@ "use strict";

async createIndex() {
await this.client.createIndex(this.schema.indexName, this.schema.dataStructure, `${this.schema.prefix}:`, this.schema.redisSchema);
let options = {
indexName: this.schema.indexName,
dataStructure: this.schema.dataStructure,
prefix: `${this.schema.prefix}:`,
schema: this.schema.redisSchema
};
if (this.schema.useStopWords === 'OFF')
options.stopWords = [];
if (this.schema.useStopWords === 'CUSTOM')
options.stopWords = this.schema.stopWords;
await this.client.createIndex(options);
}

@@ -20,0 +30,0 @@ async dropIndex() {

@@ -24,1 +24,2 @@ export interface Field {

export declare type IdStrategy = () => string;
export declare type StopWordOptions = 'OFF' | 'DEFAULT' | 'CUSTOM';
import { SearchDataStructure } from "../client";
import { IdStrategy } from "./schema-definitions";
import { IdStrategy, StopWordOptions } from "./schema-definitions";
export declare type SchemaOptions = {

@@ -8,2 +8,4 @@ prefix?: string;

idStrategy?: IdStrategy;
useStopWords?: StopWordOptions;
stopWords?: string[];
};
import { SearchDataStructure } from '../client';
import Entity from "../entity/entity";
import { EntityConstructor } from '../entity/entity';
import { SchemaDefinition } from './schema-definitions';
import { SchemaDefinition, StopWordOptions } from './schema-definitions';
import { SchemaOptions } from './schema-options';

@@ -14,2 +14,4 @@ export default class Schema<TEntity extends Entity> {

get dataStructure(): SearchDataStructure;
get useStopWords(): StopWordOptions;
get stopWords(): string[];
get redisSchema(): string[];

@@ -16,0 +18,0 @@ generateId(): string;

@@ -19,2 +19,4 @@ "use strict";

get dataStructure() { var _a, _b; return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.dataStructure) !== null && _b !== void 0 ? _b : 'HASH'; }
get useStopWords() { var _a, _b; return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.useStopWords) !== null && _b !== void 0 ? _b : 'DEFAULT'; }
get stopWords() { var _a, _b; return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.stopWords) !== null && _b !== void 0 ? _b : []; }
get redisSchema() { return new schema_builder_1.default(this).redisSchema; }

@@ -57,2 +59,4 @@ generateId() {

throw Error(`'${this.dataStructure}' in an invalid data structure. Valid data structures are 'HASH' and 'JSON'.`);
if (!['OFF', 'DEFAULT', 'CUSTOM'].includes(this.useStopWords))
throw Error(`'${this.useStopWords}' in an invalid value for stop words. Valid values are 'OFF', 'DEFAULT', and 'CUSTOM'.`);
if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.idStrategy) && !(this.options.idStrategy instanceof Function))

@@ -59,0 +63,0 @@ throw Error("ID strategy must be a function that takes no arguments and returns a string.");

@@ -13,3 +13,3 @@ import Schema from "../schema/schema";

count(): Promise<number>;
return(offset: number, pageSize: number): Promise<TEntity[]>;
return(offset: number, count: number): Promise<TEntity[]>;
returnAll(options?: {

@@ -24,2 +24,3 @@ pageSize: number;

or(subSearchFn: SubSearchFunction<TEntity>): Search<TEntity>;
private callSearch;
private anyWhere;

@@ -26,0 +27,0 @@ private anyWhereForField;

@@ -14,2 +14,3 @@ "use strict";

const results_converter_1 = require("./results-converter");
const __1 = require("..");
class Search {

@@ -26,3 +27,3 @@ constructor(schema, client) {

async count() {
let searchResults = await this.client.search(this.schema.indexName, this.query, 0, 0);
let searchResults = await this.callSearch();
return this.schema.dataStructure === 'JSON'

@@ -32,4 +33,4 @@ ? new results_converter_1.JsonSearchResultsConverter(this.schema, searchResults).count

}
async return(offset, pageSize) {
let searchResults = await this.client.search(this.schema.indexName, this.query, offset, pageSize);
async return(offset, count) {
let searchResults = await this.callSearch(offset, count);
return this.schema.dataStructure === 'JSON'

@@ -61,2 +62,22 @@ ? new results_converter_1.JsonSearchResultsConverter(this.schema, searchResults).entities

}
async callSearch(offset = 0, count = 0) {
let options = {
indexName: this.schema.indexName,
query: this.query,
offset,
count
};
let searchResults;
try {
searchResults = await this.client.search(options);
}
catch (error) {
let message = error.message;
if (message.startsWith("Syntax error")) {
throw new __1.RedisError(`The query to RediSearch had a syntax error: "${message}".\nThis is often the result of using a stop word in the query. Either change the query to not use a stop word or change the stop words in the schema definition. You can check the RediSearch source for the default stop words at: https://github.com/RediSearch/RediSearch/blob/master/src/stopwords.h.`);
}
throw error;
}
return searchResults;
}
anyWhere(ctor, fieldOrFn) {

@@ -63,0 +84,0 @@ if (typeof fieldOrFn === 'string') {

@@ -17,4 +17,3 @@ "use strict";

matchExact(value) {
this.value = value;
this.exactValue = true;
this.exact.value = value;
return this.search;

@@ -21,0 +20,0 @@ }

@@ -50,3 +50,3 @@ [redis-om](../README.md) / Client

[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/3233465/lib/client.ts#L96)

@@ -81,3 +81,3 @@ ___

[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/3233465/lib/client.ts#L73)

@@ -112,3 +112,3 @@ ___

[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/3233465/lib/client.ts#L88)

@@ -135,2 +135,2 @@ ___

[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/3233465/lib/client.ts#L60)

@@ -28,2 +28,2 @@ [redis-om](../README.md) / Entity

[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/3233465/lib/entity/entity.ts#L22)

@@ -47,3 +47,3 @@ [redis-om](../README.md) / RedisError

[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/3233465/lib/errors.ts#L2)

@@ -62,3 +62,3 @@ ## Properties

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

@@ -77,3 +77,3 @@ ___

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

@@ -92,3 +92,3 @@ ___

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

@@ -95,0 +95,0 @@ ___

@@ -85,3 +85,3 @@ [redis-om](../README.md) / Repository

[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/3233465/lib/repository/repository.ts#L60)

@@ -104,3 +104,3 @@ ## Methods

[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/3233465/lib/repository/repository.ts#L106)

@@ -122,3 +122,3 @@ ___

[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/3233465/lib/repository/repository.ts#L71)

@@ -141,3 +141,3 @@ ___

[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/3233465/lib/repository/repository.ts#L90)

@@ -168,3 +168,3 @@ ___

[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/3233465/lib/repository/repository.ts#L144)

@@ -192,3 +192,3 @@ ___

[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/3233465/lib/repository/repository.ts#L165)

@@ -218,3 +218,3 @@ ___

[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/3233465/lib/repository/repository.ts#L117)

@@ -238,2 +238,2 @@ ___

[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/3233465/lib/repository/repository.ts#L176)

@@ -16,3 +16,3 @@ [redis-om](../README.md) / Schema

}, {
dataStructure: 'JSON
dataStructure: 'JSON'
});

@@ -41,2 +41,4 @@ ```

- [prefix](Schema.md#prefix)
- [stopWords](Schema.md#stopwords)
- [useStopWords](Schema.md#usestopwords)

@@ -69,3 +71,3 @@ ### Methods

[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/3233465/lib/schema/schema.ts#L53)

@@ -87,3 +89,3 @@ ## Accessors

[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/3233465/lib/schema/schema.ts#L72)

@@ -104,3 +106,3 @@ ___

[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/3233465/lib/schema/schema.ts#L66)

@@ -121,4 +123,39 @@ ___

[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/3233465/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/3233465/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/3233465/lib/schema/schema.ts#L79)
## Methods

@@ -138,2 +175,2 @@

[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/3233465/lib/schema/schema.ts#L94)

@@ -46,3 +46,3 @@ [redis-om](../README.md) / Search

[lib/search/search.ts:124](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/search.ts#L124)
[lib/search/search.ts:125](https://github.com/redis/redis-om-node/blob/3233465/lib/search/search.ts#L125)

@@ -67,3 +67,3 @@ ▸ **and**(`subSearchFn`): [`Search`](Search.md)<`TEntity`\>

[lib/search/search.ts:131](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/search.ts#L131)
[lib/search/search.ts:132](https://github.com/redis/redis-om-node/blob/3233465/lib/search/search.ts#L132)

@@ -84,3 +84,3 @@ ___

[lib/search/search.ts:51](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/search.ts#L51)
[lib/search/search.ts:52](https://github.com/redis/redis-om-node/blob/3233465/lib/search/search.ts#L52)

@@ -109,3 +109,3 @@ ___

[lib/search/search.ts:141](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/search.ts#L141)
[lib/search/search.ts:142](https://github.com/redis/redis-om-node/blob/3233465/lib/search/search.ts#L142)

@@ -130,3 +130,3 @@ ▸ **or**(`subSearchFn`): [`Search`](Search.md)<`TEntity`\>

[lib/search/search.ts:148](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/search.ts#L148)
[lib/search/search.ts:149](https://github.com/redis/redis-om-node/blob/3233465/lib/search/search.ts#L149)

@@ -137,3 +137,3 @@ ___

▸ **return**(`offset`, `pageSize`): `Promise`<`TEntity`[]\>
▸ **return**(`offset`, `count`): `Promise`<`TEntity`[]\>

@@ -147,3 +147,3 @@ Returns a page of [Entities](Entity.md) that match this query.

| `offset` | `number` | The offset for where to start returning [Entities](Entity.md). |
| `pageSize` | `number` | The number of [Entities](Entity.md) to return. |
| `count` | `number` | - |

@@ -158,3 +158,3 @@ #### Returns

[lib/search/search.ts:64](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/search.ts#L64)
[lib/search/search.ts:65](https://github.com/redis/redis-om-node/blob/3233465/lib/search/search.ts#L65)

@@ -191,3 +191,3 @@ ___

[lib/search/search.ts:85](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/search.ts#L85)
[lib/search/search.ts:86](https://github.com/redis/redis-om-node/blob/3233465/lib/search/search.ts#L86)

@@ -217,3 +217,3 @@ ___

[lib/search/search.ts:106](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/search.ts#L106)
[lib/search/search.ts:107](https://github.com/redis/redis-om-node/blob/3233465/lib/search/search.ts#L107)

@@ -239,2 +239,2 @@ ▸ **where**(`subSearchFn`): [`Search`](Search.md)<`TEntity`\>

[lib/search/search.ts:114](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/search.ts#L114)
[lib/search/search.ts:115](https://github.com/redis/redis-om-node/blob/3233465/lib/search/search.ts#L115)

@@ -43,2 +43,2 @@ [redis-om](../README.md) / Where

[lib/search/where.ts:8](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where.ts#L8)
[lib/search/where.ts:8](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where.ts#L8)

@@ -75,3 +75,3 @@ [redis-om](../README.md) / WhereField

[lib/search/where-field.ts:79](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L79)
[lib/search/where-field.ts:79](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L79)

@@ -91,3 +91,3 @@ ___

[lib/search/where-field.ts:86](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L86)
[lib/search/where-field.ts:86](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L86)

@@ -110,3 +110,3 @@ ## Accessors

[lib/search/where-field.ts:227](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L227)
[lib/search/where-field.ts:227](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L227)

@@ -129,3 +129,3 @@ ___

[lib/search/where-field.ts:219](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L219)
[lib/search/where-field.ts:219](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L219)

@@ -149,3 +149,3 @@ ___

[lib/search/where-field.ts:236](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L236)
[lib/search/where-field.ts:236](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L236)

@@ -175,3 +175,3 @@ ## Methods

[lib/search/where-field.ts:162](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L162)
[lib/search/where-field.ts:162](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L162)

@@ -200,3 +200,3 @@ ___

[lib/search/where-field.ts:169](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L169)
[lib/search/where-field.ts:169](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L169)

@@ -226,3 +226,3 @@ ___

[lib/search/where-field.ts:184](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L184)
[lib/search/where-field.ts:184](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L184)

@@ -251,3 +251,3 @@ ___

[lib/search/where-field.ts:176](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L176)
[lib/search/where-field.ts:176](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L176)

@@ -277,3 +277,3 @@ ___

[lib/search/where-field.ts:192](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L192)
[lib/search/where-field.ts:192](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L192)

@@ -302,3 +302,3 @@ ___

[lib/search/where-field.ts:16](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L16)
[lib/search/where-field.ts:16](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L16)

@@ -327,3 +327,3 @@ ___

[lib/search/where-field.ts:23](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L23)
[lib/search/where-field.ts:23](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L23)

@@ -352,3 +352,3 @@ ___

[lib/search/where-field.ts:37](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L37)
[lib/search/where-field.ts:37](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L37)

@@ -377,3 +377,3 @@ ___

[lib/search/where-field.ts:30](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L30)
[lib/search/where-field.ts:30](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L30)

@@ -396,3 +396,3 @@ ___

[lib/search/where-field.ts:98](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L98)
[lib/search/where-field.ts:98](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L98)

@@ -421,3 +421,3 @@ ___

[lib/search/where-field.ts:112](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L112)
[lib/search/where-field.ts:112](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L112)

@@ -446,3 +446,3 @@ ___

[lib/search/where-field.ts:126](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L126)
[lib/search/where-field.ts:126](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L126)

@@ -471,3 +471,3 @@ ___

[lib/search/where-field.ts:105](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L105)
[lib/search/where-field.ts:105](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L105)

@@ -496,3 +496,3 @@ ___

[lib/search/where-field.ts:119](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L119)
[lib/search/where-field.ts:119](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L119)

@@ -521,3 +521,3 @@ ___

[lib/search/where-field.ts:140](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L140)
[lib/search/where-field.ts:140](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L140)

@@ -546,3 +546,3 @@ ___

[lib/search/where-field.ts:154](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L154)
[lib/search/where-field.ts:154](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L154)

@@ -571,3 +571,3 @@ ___

[lib/search/where-field.ts:133](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L133)
[lib/search/where-field.ts:133](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L133)

@@ -596,3 +596,3 @@ ___

[lib/search/where-field.ts:147](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L147)
[lib/search/where-field.ts:147](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L147)

@@ -621,3 +621,3 @@ ___

[lib/search/where-field.ts:44](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L44)
[lib/search/where-field.ts:44](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L44)

@@ -646,3 +646,3 @@ ___

[lib/search/where-field.ts:58](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L58)
[lib/search/where-field.ts:58](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L58)

@@ -671,3 +671,3 @@ ___

[lib/search/where-field.ts:65](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L65)
[lib/search/where-field.ts:65](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L65)

@@ -696,3 +696,3 @@ ___

[lib/search/where-field.ts:51](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L51)
[lib/search/where-field.ts:51](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L51)

@@ -721,3 +721,3 @@ ___

[lib/search/where-field.ts:72](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L72)
[lib/search/where-field.ts:72](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L72)

@@ -742,3 +742,3 @@ ___

[lib/search/where-field.ts:241](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L241)
[lib/search/where-field.ts:241](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L241)

@@ -761,2 +761,2 @@ ___

[lib/search/where-field.ts:92](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/search/where-field.ts#L92)
[lib/search/where-field.ts:92](https://github.com/redis/redis-om-node/blob/3233465/lib/search/where-field.ts#L92)

@@ -36,3 +36,3 @@ [redis-om](../README.md) / ArrayField

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

@@ -52,3 +52,3 @@ ___

[lib/schema/schema-definitions.ts:50](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema-definitions.ts#L50)
[lib/schema/schema-definitions.ts:50](https://github.com/redis/redis-om-node/blob/3233465/lib/schema/schema-definitions.ts#L50)

@@ -65,2 +65,2 @@ ___

[lib/schema/schema-definitions.ts:42](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema-definitions.ts#L42)
[lib/schema/schema-definitions.ts:42](https://github.com/redis/redis-om-node/blob/3233465/lib/schema/schema-definitions.ts#L42)

@@ -35,3 +35,3 @@ [redis-om](../README.md) / BooleanField

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

@@ -48,2 +48,2 @@ ___

[lib/schema/schema-definitions.ts:36](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema-definitions.ts#L36)
[lib/schema/schema-definitions.ts:36](https://github.com/redis/redis-om-node/blob/3233465/lib/schema/schema-definitions.ts#L36)

@@ -36,2 +36,2 @@ [redis-om](../README.md) / Field

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

@@ -35,3 +35,3 @@ [redis-om](../README.md) / NumericField

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

@@ -48,2 +48,2 @@ ___

[lib/schema/schema-definitions.ts:13](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema-definitions.ts#L13)
[lib/schema/schema-definitions.ts:13](https://github.com/redis/redis-om-node/blob/3233465/lib/schema/schema-definitions.ts#L13)

@@ -37,3 +37,3 @@ [redis-om](../README.md) / StringField

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

@@ -53,3 +53,3 @@ ___

[lib/schema/schema-definitions.ts:30](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema-definitions.ts#L30)
[lib/schema/schema-definitions.ts:30](https://github.com/redis/redis-om-node/blob/3233465/lib/schema/schema-definitions.ts#L30)

@@ -66,3 +66,3 @@ ___

[lib/schema/schema-definitions.ts:22](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema-definitions.ts#L22)
[lib/schema/schema-definitions.ts:22](https://github.com/redis/redis-om-node/blob/3233465/lib/schema/schema-definitions.ts#L22)

@@ -79,2 +79,2 @@ ___

[lib/schema/schema-definitions.ts:19](https://github.com/redis/redis-om-node/blob/20e6b1d/lib/schema/schema-definitions.ts#L19)
[lib/schema/schema-definitions.ts:19](https://github.com/redis/redis-om-node/blob/3233465/lib/schema/schema-definitions.ts#L19)

@@ -35,2 +35,3 @@ redis-om

- [SearchDataStructure](README.md#searchdatastructure)
- [StopWordOptions](README.md#stopwordoptions)
- [SubSearchFunction](README.md#subsearchfunction)

@@ -65,3 +66,3 @@

[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/3233465/lib/entity/entity.ts#L10)

@@ -82,3 +83,3 @@ ___

[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/3233465/lib/entity/entity.ts#L4)

@@ -95,3 +96,3 @@ ___

[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/3233465/lib/schema/schema-definitions.ts#L54)

@@ -116,3 +117,3 @@ ___

[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/3233465/lib/schema/schema-definitions.ts#L68)

@@ -136,3 +137,3 @@ ___

[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/3233465/lib/schema/schema-definitions.ts#L59)

@@ -155,6 +156,8 @@ ___

| `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/3233465/lib/schema/schema-options.ts#L7)

@@ -171,6 +174,18 @@ ___

[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/3233465/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/3233465/lib/schema/schema-definitions.ts#L71)
___
### SubSearchFunction

@@ -204,2 +219,2 @@

[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/3233465/lib/search/search.ts#L22)
{
"name": "redis-om",
"version": "0.1.3",
"version": "0.1.4",
"description": "Object mapping, and more, for Redis and Node.js. Written in TypeScript.",

@@ -9,2 +9,4 @@ "main": "dist/index.js",

"README.md",
"CHANGELOG",
"LICENSE",
"logo.svg",

@@ -16,5 +18,5 @@ "dist/**/*",

"docs": "rm -rf ./docs && typedoc",
"test-all": "jest --watchAll --runInBand",
"test-unit": "jest --selectProjects unit --watchAll",
"test-functional": "jest --selectProjects functional --watchAll --runInBand"
"test-all": "jest --runInBand",
"test-unit": "jest --selectProjects unit",
"test-functional": "jest --selectProjects functional --runInBand"
},

@@ -21,0 +23,0 @@ "repository": "github:redis/redis-om-node",

@@ -16,4 +16,11 @@ <div align="center">

---
[![License][license-image]][license-url]
[![Discord][discord-shield]][discord-url]
[![Twitch][twitch-shield]][twitch-url]
[![YouTube][youtube-shield]][youtube-url]
[![Twitter][twitter-shield]][twitter-url]
[![NPM][package-shield]][package-url]
[![Build][build-shield]][build-url]
[![License][license-shield]][license-url]
**Redis OM Node.js** makes it easy to model Redis data in your Node.js applications.

@@ -719,5 +726,18 @@

[license-image]: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg
[package-shield]: https://img.shields.io/npm/v/redis-om?logo=npm
[build-shield]: https://img.shields.io/github/workflow/status/redis/redis-om-node/CI/main
[license-shield]: https://img.shields.io/npm/l/redis-om
[discord-shield]: https://img.shields.io/discord/697882427875393627?style=social&logo=discord
[twitch-shield]: https://img.shields.io/twitch/status/redisinc?style=social
[twitter-shield]: https://img.shields.io/twitter/follow/redisinc?style=social
[youtube-shield]: https://img.shields.io/youtube/channel/views/UCD78lHSwYqMlyetR0_P4Vig?style=social
[package-url]: https://www.npmjs.com/package/redis-om
[build-url]: https://github.com/redis/redis-om-node/actions/workflows/ci.yml
[license-url]: LICENSE
[discord-url]: http://discord.gg/redis
[twitch-url]: https://www.twitch.tv/redisinc
[twitter-url]: https://twitter.com/redisinc
[youtube-url]: https://www.youtube.com/redisinc
[redis-cloud-url]: https://redis.com/try-free/

@@ -724,0 +744,0 @@ [redisearch-url]: https://oss.redis.com/redisearch/

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc