{"id":46139,"library":"redis-om-type","title":"Redis OM Type","description":"TypeScript-based Node.js library (v1.0.3) for Redis object mapping, schemas, repositories, and fluent search over JSON and hashes. Supports RediSearch and RedisJSON modules. Provides strong typing, fluent search API with chaining, pagination, full-text search, and spatial queries. Requires Node >= 14 and a Redis instance with the RediSearch and RedisJSON modules. Follows the same model as Redis OM for Node.js with TypeScript declarations. Actively maintained by Redis.","status":"active","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/redis/redis-om-node","tags":["javascript","redis","redis-om","orm","typescript","object-mapping","redisearch","redisjson"],"install":[{"cmd":"npm install redis-om-type","lang":"bash","label":"npm"},{"cmd":"yarn add redis-om-type","lang":"bash","label":"yarn"},{"cmd":"pnpm add redis-om-type","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Redis client for Node.js (node-redis)","package":"redis","optional":true},{"reason":"Node Redis client library","package":"@redis/client","optional":true}],"imports":[{"note":"ESM only; use require with .default in CJS or use dynamic import.","wrong":"const { Schema } = require('redis-om-type')","symbol":"Schema","correct":"import { Schema } from 'redis-om-type'"},{"note":"The package is redis-om-type, not redis-om (upstream).","wrong":"import { Repository } from 'redis-om'","symbol":"Repository","correct":"import { Repository } from 'redis-om-type'"},{"note":"Use the Client class from redis-om-type to wrap node-redis client.","wrong":"const client = new Redis();","symbol":"Client","correct":"import { Client } from 'redis-om-type'"}],"quickstart":{"code":"import { Client, Entity, Schema, Repository } from 'redis-om-type';\n\n// Create a Redis client\nconst client = new Client();\nawait client.open(process.env.REDIS_URL ?? 'redis://localhost:6379');\n\n// Define a schema\nconst albumSchema = new Schema('album', {\n  artist: { type: 'string' },\n  title: { type: 'text' },\n  year: { type: 'number' },\n});\n\n// Create repository\nconst repository = new Repository(albumSchema, client);\n\n// Create an entity\nconst album = repository.createEntity();\nalbum.artist = 'Mushroomhead';\nalbum.title = 'The Righteous & The Butterfly';\nalbum.year = 2014;\n\n// Save entity\nconst id = await repository.save(album);\nconsole.log('Saved entity with ID:', id);\n\n// Search\nconst albums = await repository.search()\n  .where('artist').equals('Mushroomhead')\n  .return.all();\n\nconsole.log('Found:', albums);\n\nawait client.close();","lang":"typescript","description":"Connects to Redis, defines a schema, saves an entity, and performs a fluent search."},"warnings":[{"fix":"Use 'text' for fields you need to search with .matches() and 'string' for fields you compare with .equals().","message":"Schema definitions use type 'text' for full-text search and 'string' for exact match; mixing them can cause unexpected query results.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Upgrade to 0.4+ and follow the new API as documented in the README.","message":"Version 0.4 introduced breaking changes relative to 0.3.x. The API changed significantly (e.g., repository API).","severity":"deprecated","affected_versions":"<0.4.0"},{"fix":"Ensure you are using redis-om-type and check its specific documentation.","message":"The package is not the official Redis OM Node.js package (redis-om); it is a TypeScript-focused fork. Some examples from official docs may not apply.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Enable the modules in your Redis config or use Redis Stack.","message":"Requires Redis with RediSearch and RedisJSON modules. If modules are not loaded, search operations will fail.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'14':46 'activ':69 'api':33 'base':6 'chain':35 'declar':68 'fluent':17,31 'follow':57 'full':38 'full-text':37 'hash':22 'instanc':50 'javascript':73 'json':20 'librari':8 'maintain':70 'map':13,82 'model':60 'modul':27,56 'node':45 'node.js':7,65 'object':12,81 'object-map':80 'om':2,63,77 'orm':78 'pagin':36 'provid':28 'queri':43 'redi':1,11,49,62,72,74,76 'redis-om':75 'redisearch':24,53,83 'redisjson':26,55,84 'repositori':15 'requir':44 'schema':14 'search':18,32,40 'spatial':42 'strong':29 'support':23 'text':39 'type':3,30 'typescript':5,67,79 'typescript-bas':4 'v1.0.3':9","created_at":"2026-06-07T12:58:28.086157+00:00","updated_at":"2026-06-07T12:58:28.086157+00:00","problems":[{"fix":"Ensure you call repository = new Repository(schema, client) after client.open().","cause":"Repository not properly initialized or client not connected.","error":"TypeError: Cannot read properties of undefined (reading 'search')"},{"fix":"Run 'npm install redis-om-type' and import using 'import { Schema } from 'redis-om-type''.","cause":"Package not installed or wrong import path.","error":"Error: Module not found: redis-om-type"},{"fix":"Use Redis Stack or load the RediSearch module (e.g., redis-server --loadmodule /path/to/redisearch.so).","cause":"Redis instance missing RediSearch module.","error":"ReplyError: ERR unknown command 'FT.SEARCH'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/redis/redis-om-node#readme","github":"https://github.com/redis/redis-om-node","docs":null,"changelog":null,"pypi":null,"npm":"redis-om-type","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}