@orion-js/mongodb 3.1.6 → 3.1.7

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.
@@ -7,6 +7,7 @@ const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
7
7
  const lodash_1 = require("lodash");
8
8
  const fromDot_1 = __importDefault(require("../../helpers/fromDot"));
9
9
  const schema_1 = require("@orion-js/schema");
10
+ const wrapErrors_1 = require("./wrapErrors");
10
11
  exports.default = (collection) => {
11
12
  const insertMany = async (docs, options = {}) => {
12
13
  for (let index = 0; index < docs.length; index++) {
@@ -24,7 +25,9 @@ exports.default = (collection) => {
24
25
  }
25
26
  docs[index] = doc;
26
27
  }
27
- const { insertedIds } = await collection.rawCollection.insertMany(docs, options.mongoOptions);
28
+ const { insertedIds } = await (0, wrapErrors_1.wrapErrors)(() => {
29
+ return collection.rawCollection.insertMany(docs, options.mongoOptions);
30
+ });
28
31
  const ids = (0, lodash_1.values)(insertedIds);
29
32
  return ids.map(id => id.toString());
30
33
  };
@@ -90,7 +90,6 @@ describe('InsertOne', () => {
90
90
  ]
91
91
  });
92
92
  await Tests.createIndexesPromise;
93
- console.log(await Tests.rawCollection.listIndexes().toArray());
94
93
  await Tests.insertOne({ name: 'one' });
95
94
  expect.assertions(3);
96
95
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-js/mongodb",
3
- "version": "3.1.6",
3
+ "version": "3.1.7",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "files": [
@@ -38,5 +38,5 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "cb180a6a89ee2042f9d3dc80725f3aa05705a963"
41
+ "gitHead": "9513b378760e379b93663128ceff8d97e5c41592"
42
42
  }