nedb-async
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -5,9 +5,9 @@ import * as Nedb from "nedb"; | ||
asyncFind<T>(query: any, projection?: T): Promise<T[]>; | ||
asyncCount(): Promise<{} | {}[]>; | ||
asyncCount(query: any): Promise<{} | {}[]>; | ||
asyncFindOne<T>(query: any, projection?: T): Promise<T>; | ||
asyncInsert(): Promise<{}>; | ||
asyncInsert<T>(newDoc: T): Promise<{}>; | ||
asyncUpdate(query: any, updateQuery: any, options?: Nedb.UpdateOptions): Promise<{}>; | ||
asyncRemove(): Promise<{}>; | ||
asyncEnsureIndex(): Promise<{}>; | ||
asyncRemoveIndex(...arg: []): Promise<{}>; | ||
asyncRemove(query: any, options?: Nedb.RemoveOptions): Promise<{}>; | ||
asyncEnsureIndex(options: Nedb.EnsureIndexOptions): Promise<{}>; | ||
asyncRemoveIndex(fieldName: string): Promise<{}>; | ||
} |
@@ -12,3 +12,3 @@ "use strict"; | ||
} | ||
asyncCount() { | ||
asyncCount(query) { | ||
return util_1.promisefy.call(this, 'count', arguments); | ||
@@ -19,3 +19,3 @@ } | ||
} | ||
asyncInsert() { | ||
asyncInsert(newDoc) { | ||
return util_1.justPromise.call(this, 'insert', arguments); | ||
@@ -26,9 +26,9 @@ } | ||
} | ||
asyncRemove() { | ||
asyncRemove(query, options) { | ||
return util_1.justPromise.call(this, 'remove', arguments); | ||
} | ||
asyncEnsureIndex() { | ||
asyncEnsureIndex(options) { | ||
return util_1.justPromise.call(this, 'ensureIndex', arguments); | ||
} | ||
asyncRemoveIndex(...arg) { | ||
asyncRemoveIndex(fieldName) { | ||
return util_1.justPromise.call(this, 'removeIndex', arguments); | ||
@@ -35,0 +35,0 @@ } |
@@ -11,2 +11,3 @@ | ||
( async () => { | ||
console.log(await db.asyncEnsureIndex({fieldName:'name', unique:true})); | ||
console.log(await db.asyncInsert({name: 'Akuma'})); | ||
@@ -13,0 +14,0 @@ |
10
index.ts
@@ -11,3 +11,3 @@ import * as Nedb from "nedb"; | ||
} | ||
asyncCount() { | ||
asyncCount(query: any) { | ||
return promisefy.call(this, 'count', arguments) | ||
@@ -18,3 +18,3 @@ } | ||
} | ||
asyncInsert() { | ||
asyncInsert<T>(newDoc: T) { | ||
return justPromise.call(this, 'insert', arguments) | ||
@@ -25,11 +25,11 @@ } | ||
} | ||
asyncRemove() { | ||
asyncRemove(query: any, options?: Nedb.RemoveOptions) { | ||
return justPromise.call(this, 'remove', arguments) | ||
} | ||
asyncEnsureIndex() { | ||
asyncEnsureIndex(options: Nedb.EnsureIndexOptions,) { | ||
return justPromise.call(this, 'ensureIndex', arguments) | ||
} | ||
asyncRemoveIndex(...arg: []) { | ||
asyncRemoveIndex(fieldName: string) { | ||
return justPromise.call(this, 'removeIndex', arguments) | ||
} | ||
} |
{ | ||
"name": "nedb-async", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Promise wrapper for Nedb that makes it possible to use all Nedb all cursor modifiers.", | ||
@@ -5,0 +5,0 @@ "repository": { |
14415
249