Redis modules type, defaults to RedisDefaultModules
Redis functions type, defaults to RedisFunctions
Redis scripts type, defaults to RedisScripts
Redis RESP protocol version, defaults to 2
Redis type mapping, defaults to TypeMapping
Creates a new RedisOMManager instance.
Redis modules type, defaults to RedisDefaultModules
Redis functions type, defaults to RedisFunctions
Redis scripts type, defaults to RedisScripts
Redis RESP protocol version, defaults to 2
Redis type mapping, defaults to TypeMapping
Configuration settings for the manager
ProtectednameThe name of this manager instance.
Static ReadonlytypeIdentifier for the manager type.
ProtectedaddProtectedAdds a Redis-OM schema as a model to this manager. Creates a Repository instance for the schema and stores it internally.
The Redis-OM schema to add
The added schema
Establishes the connection to Redis.
A promise that resolves to this manager instance for method chaining
Creates indexes in Redis for use by the Repository#search method. Does not create a new index for an index that hasn't changed. Requires that RediSearch and RedisJSON are installed on your instance of Redis.
A promise that resolves when all indexes are created
Removes existing indexes from Redis. Use this method if you want to swap out your indexes because your Entities have changed. Requires that RediSearch and RedisJSON are installed on your instance of Redis.
A promise that resolves when all indexes are dropped
Gets the underlying Redis client connection.
The Redis client instance
Retrieves a registered Redis-OM Repository by its schema name.
The entity type that defines the structure of data stored in the repository. Defaults to Record<string, any>
The schema name of the model to retrieve
The Repository instance typed with the entity structure, or undefined if not found
// Without type parameter
const userRepo = manager.getModel('User');
if (userRepo) {
const users = await userRepo.search().return.all();
}
// With typed entity
interface User {
name: string;
email: string;
age: number;
}
const userRepo = manager.getModel<User>('User');
if (userRepo) {
const users = await userRepo.search().return.all();
// users will be typed as Array<User & Entity>
}
Performs a comprehensive health check on the Redis connection. Tests connectivity by sending a PING command and gathering connection metrics.
A promise that resolves to a detailed health check result including:
Manager class for Redis-OM (Object Mapping) integration with Storehouse. Provides connection management, model registration, and health checking for Redis databases.
This manager wraps the Redis client and Redis-OM repositories, offering a unified interface for working with Redis as a document store using the Redis-OM library.
Implements
Example