js-data-redis
Redis adapter for js-data.
To get started, visit http://js-data.io.
Table of contents
- Quick start
- Example App
- Guides and Tutorials
- API Reference Docs
- Community
- Support
- Contributing
- License
Quick Start
npm install --save js-data js-data-redis redis
.
// Use Container instead of DataStore on the server
import {Container} from 'js-data'
import RedisAdapter from 'js-data-redis'
// Create a store to hold your Mappers
const store = new Container()
// Create an instance of RedisAdapter with default settings
const adapter = new RedisAdapter()
// Mappers in "store" will use the Redis adapter by default
store.registerAdapter('redis', adapter, { default: true })
// Create a Mapper that maps to a "user" table
store.defineMapper('user')
async function findAllAdminUsers () {
// Find all users where "user.role" == "admin"
return await store.findAll('user', {
role: 'admin'
})
}
Guides and Tutorials
Get started at http://js-data.io
API Reference Docs
Community
Support
Contributing
License
The MIT License (MIT)
Copyright (c) 2014-2016 js-data-redis project authors