Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • KeyMongo

Index

Constructors

constructor

  • new KeyMongo(options: keyOptions): KeyMongo

Properties

Readonly clientDb

clientDb: MongoClient

Readonly db

db: Db

Methods

delete

  • delete(collectionName: string, key: string | number): any
  • example

    key_mongo.delete('database', 'user_1')

    Parameters

    • collectionName: string
    • key: string | number

    Returns any

    any|number|string

deleteData

  • deleteData(collectionName: string, key: string | number, insert: string | number): Promise<any>
  • example

    key_mongo.deleteData('database', 'user_1', 'money')

    Parameters

    • collectionName: string
    • key: string | number
    • insert: string | number

    Returns Promise<any>

    Promise

drop

  • drop(collectionName: string): Promise<any>
  • example

    key_mongo.drop('database')

    Parameters

    • collectionName: string

    Returns Promise<any>

    Promise

get

  • get(collectionName: string, key: string | number): Promise<any>
  • example

    key_mongo.get('database', 'user_1')

    Parameters

    • collectionName: string
    • key: string | number

    Returns Promise<any>

    Promise

has

  • has(collectionName: string, key: string | number): Promise<any>
  • example

    key_mongo.has('database', 'user_1')

    Parameters

    • collectionName: string
    • key: string | number

    Returns Promise<any>

    Promise<any|boolean>

list

  • list(collectionName: string): Promise<any>
  • example

    key_mongo.list('database')

    Parameters

    • collectionName: string

    Returns Promise<any>

    Promise

set

  • set(collectionName: string, key: string | number, value: unknown): any
  • example

    key_mongo.set('database', 'user_1', { money: 20 })

    Parameters

    • collectionName: string
    • key: string | number
    • value: unknown

    Returns any

    any

updateData

  • updateData(collectionName: string, key: string | number, insert: string | number, value: unknown): Promise<any>
  • example

    key_mongo.updateData('database', 'user_1', 'money', 69)

    Parameters

    • collectionName: string
    • key: string | number
    • insert: string | number
    • value: unknown

    Returns Promise<any>

    Promise

Generated using TypeDoc