Registry / database / jugglingdb-redis-hq

jugglingdb-redis-hq

JSON →
library0.1.4jsnpmunverified

Legacy Redis adapter for JugglingDB (predecessor to LoopBack). Version 0.1.4 is the last release. Unmaintained since 2013. Requires jugglingdb@0.2.x. Supports a 'backyard' feature to offload cold data to a SQL database, but this is fragile and not recommended. No TypeScript types, no ESM support, no active development. Consider migrating to LoopBack's Redis connector or ioredis directly.

npm install jugglingdb-redis-hq
INSTALL
IMPORT
SIG · JUGGLINGDB-REDIS-H
J
jugglingdb-redis-hq
databasejavascriptv0.1.4
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.

Schema
var Schema = require('jugglingdb').Schema;
var Schema = require('jugglingdb-redis');
The adapter is not required directly; you pass 'redis' as the driver name to JugglingDB Schema.
schema instance
var schema = new Schema('redis', { database: 1 });
var schema = new Schema('jugglingdb-redis');
Driver name is 'redis', not the package name.
model definition with expire
var Comment = schema.define('Comment', { text: String }, { expire: 30 });
Expire setting is passed as third argument to define().

Basic usage: create a JugglingDB schema with Redis adapter, define a model, create and retrieve a record.

// Install: npm install jugglingdb jugglingdb-redis-hq var Schema = require('jugglingdb').Schema; var schema = new Schema('redis', { database: 1 }); var Post = schema.define('Post', { title: String, content: String }); Post.create({ title: 'Hello', content: 'World' }, function(err, post) { if (err) throw err; console.log('Created:', post.id); Post.find(post.id, function(err, found) { if (err) throw err; console.log('Found:', found.title); }); });
Debug
Known issues
breakingRequires jugglingdb@0.2.x; incompatible with jugglingdb 1.x or later.
fix
Use jugglingdb@0.2.x or migrate to LoopBack.
affects: >=0.3.0
breakingNo longer maintained; known vulnerabilities may exist in dependencies.
fix
Migrate to a maintained Redis adapter.
affects: >=0.0.0
deprecatedThe 'backyard' feature is deprecated and may cause data inconsistency.
fix
Avoid using backyard; manage cache separately.
affects: >=0.0.0
gotchaRunning tests will delete all data in Redis database number 0.
fix
Set a different database number for testing.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'jugglingdb-redis'
Installed wrong package name or forgot to install
fix
Run: npm install jugglingdb-redis-hq (not 'jugglingdb-redis')
TypeError: Schema is not a constructor
Importing Schema from the wrong package (e.g., from 'jugglingdb-redis' instead of 'jugglingdb')
fix
Use: var Schema = require('jugglingdb').Schema;
Error: Cannot find module 'jugglingdb'
Missing peer dependency jugglingdb
fix
Install jugglingdb@0.2.x: npm install jugglingdb@0.2
Upgrade
Version history
0.1.4latest on npm
Audit
Dependencies
jugglingdbrequiredpeer dependency – requires jugglingdb@0.2.x to work
Agent activity
6 hits · last 30 days
node
6
Resources
jugglingdb-redis-hq — npm install jugglingdb-redis-hq · libregistry