Constructors
constructor
- new BridgeStore(db: Nedb<any>): BridgeStore
-
Properties
Readonly
db
db: Nedb<any>
Methods
convertTo
- convertTo<T, O>(func: ((input: T) => O)): ((doc: T) => O)
-
Returns ((doc: T) => O)
delete
- delete(query: Query): Promise<number>
-
Returns Promise<number>
insert
- insert(objects: unknown): Promise<any[]>
-
Returns Promise<any[]>
insertIfNotExists
- insertIfNotExists(query: Query, insertObj: Record<string, unknown>): Promise<void>
-
Parameters
-
query: Query
-
insertObj: Record<string, unknown>
Returns Promise<void>
select
- select<T, O>(query: Query, transformFn?: ((input: T) => O)): Promise<O[]>
-
Parameters
-
query: Query
-
Optional
transformFn: ((input: T) => O)
Returns Promise<O[]>
selectOne
- selectOne<T, O>(query: Query, transformFn?: ((input: T) => O)): Promise<null | O>
-
Parameters
-
query: Query
-
Optional
transformFn: ((input: T) => O)
Returns Promise<null | O>
setUnique
- setUnique(fieldName: string, sparse?: boolean): void
-
Parameters
-
fieldName: string
-
sparse: boolean = false
Returns void
update
- update(query: Query, updateVals: Record<string, unknown>): Promise<void>
-
Parameters
-
query: Query
-
updateVals: Record<string, unknown>
Returns Promise<void>
upsert
- upsert<T>(query: Query, updateVals: T): Promise<void>
-
Parameters
-
query: Query
-
updateVals: T
Returns Promise<void>
Base class for bridge stores.