0.0.5 • Published 3 years ago

redis-odm v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Redis-odm

Redis Object Document Mapping for Node.js

Redis-Stack or redis json module is required.

Usage

    import { model } from 'redis-odm';

    // auto completion and type checking
    type PostType = {
      title: string
      content: string
      views: number
    }
    
    // create a typed model
    const Post = model<PostType>('post')

    // create a document
    const post = Post.create({
      title: 'awesome blog post',
      content: 'content',
      views: 0
    })


    // make sure document is synced with redis
    await post.save()

    // modify document;
    post.content += 'extra content';
    post.views++

    await post.save()
0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago