Skip to content

Latest commit

 

History

History
168 lines (118 loc) · 3.86 KB

api.md

File metadata and controls

168 lines (118 loc) · 3.86 KB

Classes

lowkie
ObjectId
lowkieSchema

Functions

connect([dbpath], [options])Promise

connects lowkie to lokijs

handler()object

this is the proxy handler for lowkie, provides access to native loki methods as well.

model(model, Schema)

lowkie model proxy for lokijs collection

lowkie

Kind: global class

new lowkie()

lowkie ORM singleton class

lowkie.Schema(scheme) ⇒

creates lowkie schema, also includes helpers for document validations

Kind: instance method of lowkie
Returns: instance of lowkieSchema

Param Type
scheme object

lowkie.lowkie

Kind: static class of lowkie

new lowkie([options])

Creates an instance of lowkie.

Param Type Default
[options] any {}

ObjectId

Kind: global class

new ObjectId()

helper class for generating Ids

ObjectId.createId()

generates a unique ID

Kind: static method of ObjectId

lowkieSchema

Kind: global class

new lowkieSchema()

proxy for creating new loki documents

lowkieSchema.createDocument(doc) ⇒

returns validated document for lokijs

Kind: instance method of lowkieSchema
Returns: object

Param Type
doc any

lowkieSchema.insert(options) ⇒

overwrites the default insert method

Kind: instance method of lowkieSchema
Returns: Promise

Param Type
options any

lowkieSchema.Types

schema data types

Kind: static property of lowkieSchema

connect([dbpath], [options]) ⇒ Promise

connects lowkie to lokijs

Kind: global function

Param Type Default
[dbpath] string "defaultDBPath"
[options] object {}

handler() ⇒ object

this is the proxy handler for lowkie, provides access to native loki methods as well.

Kind: global function

model(model, Schema) ⇒

lowkie model proxy for lokijs collection

Kind: global function
Returns: Proxy

Param Type Description
model string name of lowkie model
Schema class instance of lokieSchema