New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

redis-objectdb

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-objectdb

Object store with an index

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Redis ObjectDB

A promise based node module for saving searchable plain JavaScript objects to Redis. All API methods are executed as atomic Lua transactions to avoid data corruption.

Installation

npm install --save redis-objectdb

Status:

Build Status

Coverage Status

Example

const RedisObjectDB = require('redis-objectdb');

let store = new RedisObjectDB('mydb');

store.setSchema({
    cars: {
        definition: {
            color: 'string',
            mileage: 'int',
            convertible: 'boolean',
            purchaseDate: 'date'
        },
        indices: {
            first: {
                uniq: true,
                fields: [ 'purchaseDate', 'mileage' ]
            },
            second: {
                uniq: false,
                fields: [ 'color', 'mileage' ]
            }
        }
    }
}).then(function(schemaId) {
    return store.create('cars', {
        color: 'blue',
        mileage: 12345,
        convertible: true,
        purchaseDate: new Date('Sun Nov 01 2015 17:41:24 GMT+0000 (UTC)')
    })
}).then(function(id) {
    return store.find('cars', id);
}).then(function(object) {
    // object = {
    //     color: 'blue',
    //     mileage: 12345,
    //     convertible: true,
    //     purchaseDate: new Date('Sun Nov 01 2015 17:41:24 GMT+0000 (UTC)')
    // }
});

API

new RedisObjectDB(options, redisOptions)

setSchema(schemaDefinition)

getSchemaHash()

create(collection, attributes)

update(collection, id, attributes)

delete(collection, id)

get(collection, id)

exists(collection, id)

list(collection)

size(collection)

multi(transaction)

find(collection, searchAttributes)

findAll(collection, searchAttributes)

quit()

Supported data types

  • Boolean
  • Integer
  • String
  • Date
  • Unix timestamp

Keywords

FAQs

Package last updated on 18 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc