assai 0.0.2 → 0.1.0

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.
package/index.mjs CHANGED
@@ -1 +1,2 @@
1
1
  export * from './src/collection.mjs'
2
+ export * from './src/mongo_client.mjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assai",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
4
  "repository": {
5
5
  "url": "https://github.com/TimeLord2010/assai",
6
6
  "type": "git"
@@ -2,7 +2,7 @@ import { Collection } from 'mongodb'
2
2
  import { getMongoClient } from './mongo_client.mjs'
3
3
  import { deleteOneOrThrow } from './usecases/operation/additional/index.mjs'
4
4
  import {
5
- count, deleteMany, deleteOne, find, findOne, insertOne, updateMany, updateOne,
5
+ count, deleteMany, deleteOne, find, findOne, insertMany, insertOne, updateMany, updateOne,
6
6
  } from './usecases/operation/index.mjs'
7
7
 
8
8
  /**
@@ -71,6 +71,11 @@ export async function getCollection(name, options = {}) {
71
71
  * @param {import('./types.js').Optional<T, 'id'>} doc
72
72
  */
73
73
  insertOne: async (doc) => await insertOne({ doc, getCollection }),
74
+ /**
75
+ *
76
+ * @param {import('./types.js').Optional<T, 'id'>[]} docs
77
+ */
78
+ insertMany: async (docs) => await insertMany({ docs, getCollection }),
74
79
  /**
75
80
  * @param {import('mongodb').Filter<T>} query
76
81
  */
@@ -4,6 +4,7 @@ export * from './delete_many.mjs'
4
4
  export * from './delete_one.mjs'
5
5
  export * from './find.mjs'
6
6
  export * from './find_one.mjs'
7
+ export * from './insert_many.mjs'
7
8
  export * from './insert_one.mjs'
8
9
  export * from './update_many.mjs'
9
10
  export * from './update_one.mjs'