corebasic 1.0.185 → 1.0.186

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/libs/elabase.js +9 -0
  2. package/package.json +1 -1
package/libs/elabase.js CHANGED
@@ -125,6 +125,15 @@ export function batchAbort(batch) { // Mandatory to prevent meory leak due to d
125
125
  }
126
126
 
127
127
  export const batch = async (callback) => { // Convenience function with auto lifecyle management and auto submit when callback returns. abort is called appropriately.
128
+ /**
129
+ * Usage:
130
+ * const result = await Dip.batch(async batch => {
131
+ * for (let i = 0; i < 45000; i++)
132
+ * Dip.insert({...meta, batch}, collection, {_id: i})
133
+ * })
134
+ *
135
+ * Note: Nested batch is supported as they are just independant batches.
136
+ */
128
137
  const batch = batchBegin()
129
138
 
130
139
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.185",
4
+ "version": "1.0.186",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {