Registry / database / deepbase-redis-json

deepbase-redis-json

JSON →
library3.6.9jsnpmunverified

Redis Stack (RedisJSON) driver for DeepBase, enabling nested JSON document storage with automatic key escaping. Current stable version 3.6.9. Requires Redis Stack (not standard Redis) for JSON module support. Provides atomic increment/decrement operations via JSON.NUMINCRBY and efficient key scanning. Supports connection to local, password-protected, TLS/SSL, and Redis Cloud instances. Works with DeepBase's multi-tier architecture as cache layer.

npm install deepbase-redis-json
INSTALL
IMPORT
SIG · DEEPBASE-REDIS-JSO
D
deepbase-redis-json
databasejavascriptv3.6.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RedisDriver
import RedisDriver from 'deepbase-redis-json'
const RedisDriver = require('deepbase-redis-json')
Default export. ESM-only since v3. Use named import { RedisDriver } if package exports it, but README shows default import.
DeepBase
import DeepBase from 'deepbase'
const DeepBase = require('deepbase')
DeepBase is a separate package, ESM-only since v3.
RedisDriver with options
new RedisDriver({ url: 'redis://localhost:6379', prefix: 'myapp', nidAlphabet: 'ABC...', nidLength: 10 })
new RedisDriver({ host: 'localhost', port: 6379 })
Driver accepts a single options object with url, prefix, nidAlphabet, nidLength. Do NOT pass host/port directly.

Create a DeepBase instance with Redis driver, connect, set/get data, and atomic increment.

import DeepBase from 'deepbase'; import RedisDriver from 'deepbase-redis-json'; const db = new DeepBase(new RedisDriver({ url: 'redis://localhost:6379', prefix: 'myapp' })); async function main() { await db.connect(); await db.set('users', 'alice', { name: 'Alice', age: 30 }); const alice = await db.get('users', 'alice'); console.log(alice); await db.inc('stats', 'views', 1); const views = await db.get('stats', 'views'); console.log(views); } main().catch(console.error);
Debug
Known issues
breakingRequires Redis Stack, not standard Redis
fix
Use Redis Stack (includes RedisJSON module). Start with: docker run -d -p 6379:6379 --name redis redis/redis-stack-server:latest
affects: >=1.0.0
deprecatedCommonJS require is deprecated in v3+
fix
Use ES module import syntax: import RedisDriver from 'deepbase-redis-json'
affects: >=3.0.0
gotchaKeys with dots, @, $, spaces, brackets are automatically escaped
fix
No action needed (transparent), but be aware that stored key may differ from original.
affects: >=3.0.0
gotchaprefix and name options may conflict - use one
fix
Pass only prefix OR name, not both. Example: { prefix: 'myapp' }
affects: >=3.0.0
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'set')
Driver not connected before using db.set()
fix
Call await db.connect() before any operations
Error: Redis connection failed: connect ECONNREFUSED ::1:6379
Redis isn't running or wrong host:port
fix
Ensure Redis Stack server is running: docker start redis or check connection URL
Error: NO JSON MODULE - Redis server does not support RedisJSON
Using standard Redis instead of Redis Stack
fix
Switch to Redis Stack image: docker run -d -p 6379:6379 redis/redis-stack-server:latest
Upgrade
Version history
3.6.9latest on npm
Audit
Dependencies
deepbaserequiredPeer dependency - this is a driver for DeepBase database abstraction
Agent activity
4 hits · last 30 days
node
4
Resources
deepbase-redis-json — npm install deepbase-redis-json · libregistry