0.0.5 • Published 2 years ago

redis-odm v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 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

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago