documentdb-util
Advanced tools
Comparing version 2.3.0 to 2.4.0
@@ -5,13 +5,17 @@ declare class DocumentDbUtility { | ||
collection(database: {}, collectionId: string): Promise<{}>; | ||
userDefinedFunction(collection:{}, udf:{ id: string, serverScript: Function }); | ||
trigger(collection: {}, proc: { id: string, serverScript: Function }); | ||
storedProcedure(collection: {}, proc: { id: string, serverScript: Function }); | ||
insert(collection: {}, documentDefinition: {}): Promise<{}>; | ||
update(docLink: string, documentDefinition: {}): Promise<{}>; | ||
query(collection: {}, querySpec: { query: string, parameters: { name: string, value: string }[] }): Promise<{}>; | ||
executeStoredProcedure(proc: {}, params?: any[]); | ||
createDocumentLink(databaseId: string, collectionId: string, documentId: string): string; | ||
delete(docLink: string): Promise<void>; | ||
query(collection: {}, querySpec: { query: string, parameters: { name: string, value: string }[] }): Promise<{}>; | ||
update(docLink: string, documentDefinition: {}): Promise<{}>; | ||
deleteDatabase(databaseId: string): Promise<{}>; | ||
deleteCollection(databaseId: string, collectionId: string): Promise<{}>; | ||
createDocumentLink(databaseId: string, collectionId: string, documentId: string): string; | ||
storedProcedure(collection: {}, proc: { id: string, serverScript: Function }); | ||
//userDefinedFunction(collection:{}, udf:{ id: string, serverScript: Function }) | ||
//createTrigger(collection: {}, proc: { id: string, serverScript: Function }) | ||
executeStoredProcedure(proc: {}, params?: any[]); | ||
deleteStoredProcedure(procedureLink: string): Promise<{}>; | ||
} | ||
@@ -18,0 +22,0 @@ |
18
index.js
@@ -115,3 +115,3 @@ var DocumentDBClient = require('documentdb').DocumentClient; | ||
if (err) return reject(err); | ||
console.log('created new'); | ||
resolve(response); | ||
@@ -121,2 +121,3 @@ }); | ||
} else { | ||
console.log('using existing') | ||
resolve(results[0]); | ||
@@ -129,2 +130,17 @@ } | ||
/** | ||
* Delete stored procedure | ||
* | ||
* @param {string} procedureLink - Procedure Link | ||
*/ | ||
deleteStoredProcedure(procedureLink) { | ||
return new Promise((resolve, reject) => { | ||
this.client.deleteStoredProcedure(procedureLink, null, (err, response) => { | ||
if (err) return reject(err); | ||
resolve(response); | ||
}); | ||
}); | ||
} | ||
/** | ||
* Create user defined function | ||
@@ -131,0 +147,0 @@ * |
{ | ||
"name": "documentdb-util", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "A little wrapper utility around document db to perform simple operations", | ||
@@ -5,0 +5,0 @@ "typings":"./index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12706
278