2.0.2 • Published 6 years ago

@hayato/store-mongo v2.0.2

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
6 years ago

config-mongo

Use MongoDB as a store

Usage

import { MongoStore } from '@hayato/store-mongo'

const store = new MongoStore()

Patch an existing store object:

import { MongoStore } from '@hayato/store-mongo'

const mongoStore = new MongoStore()

store.moduleStore = mongoStore.moduleStore
store.userStore = mongoStore.userStore
store.messageMetadataStore = mongoStore.messageMetadataStore

Schema

The prefix hayato_ can be changed on the store.

  • hayato_modules - module config
    • _id = moduleKey
    • value
  • hayato_users - user store
    • _id: { userId, moduleKey, key }
    • value
  • hayato_messages - message metadata store. A unique index is created for { messageId, moduleKey, key }.
    • _id: default
    • messageId
    • moduleKey
    • key
    • value
2.0.2

6 years ago

2.0.0

6 years ago