firestore-large-batch
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -56,3 +56,5 @@ import * as firestore from "@google-cloud/firestore"; | ||
*/ | ||
commit(commitUnit?: number): Promise<void>; | ||
commit(options: { | ||
commitUnit?: number; | ||
}): Promise<void>; | ||
/** | ||
@@ -59,0 +61,0 @@ * Commits all batches and reset the batch array and operation count |
@@ -94,4 +94,4 @@ "use strict"; | ||
*/ | ||
async commit(commitUnit) { | ||
if (!commitUnit) { | ||
async commit(options) { | ||
if (!options.commitUnit) { | ||
await this.commitBatches(this.batches); | ||
@@ -101,4 +101,4 @@ } | ||
const slicedBatches = Array(); | ||
for (let i = 0; i < this.batches.length; i += commitUnit) { | ||
const chunk = this.batches.slice(i, i + commitUnit); | ||
for (let i = 0; i < this.batches.length; i += options.commitUnit) { | ||
const chunk = this.batches.slice(i, i + options.commitUnit); | ||
slicedBatches.push(chunk); | ||
@@ -105,0 +105,0 @@ } |
{ | ||
"name": "firestore-large-batch", | ||
"version": "0.0.2", | ||
"description": "Firestore writeBatch extension for 500 more operations.", | ||
"version": "0.0.3", | ||
"description": "A library for limitless batching operations in Firestore", | ||
"main": "dist/index.js", | ||
@@ -24,3 +24,11 @@ "files": [ | ||
"prettier": "^2.8.3" | ||
} | ||
}, | ||
"repository": "git@github.com:santa112358/firestore-large-batch.git", | ||
"keywords": [ | ||
"firestore", | ||
"firebase", | ||
"batch", | ||
"500", | ||
"migration" | ||
] | ||
} |
@@ -38,3 +38,3 @@ # firestore-large-batch | ||
```typescript | ||
largeBatch.commit(10); | ||
largeBatch.commit({ commitUnit: 10 }); | ||
``` | ||
@@ -41,0 +41,0 @@ |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
10748
183