@point-hub/papi 0.5.19 → 0.5.20

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/lib/index.js CHANGED
@@ -72965,6 +72965,9 @@ class MongoDBHelper {
72965
72965
  }
72966
72966
  });
72967
72967
  }
72968
+ async createIndex(collection, spec, options) {
72969
+ await this.db.createIndex(collection, spec, options);
72970
+ }
72968
72971
  async isExists(name) {
72969
72972
  const collections = await this.db.listCollections();
72970
72973
  return collections.some(function(collection) {
@@ -1,3 +1,4 @@
1
+ import { CreateIndexesOptions, IndexSpecification } from 'mongodb';
1
2
  import { IDatabase } from '../../index';
2
3
  /**
3
4
  * https://www.mongodb.com/docs/drivers/node/current/fundamentals/indexes/
@@ -29,6 +30,7 @@ export declare class MongoDBHelper {
29
30
  * Create unique if column is exists
30
31
  */
31
32
  createUniqueIfNotNull(collection: string, properties: object): Promise<void>;
33
+ createIndex(collection: string, spec: IndexSpecification, options?: CreateIndexesOptions): Promise<void>;
32
34
  isExists(name: string): Promise<boolean>;
33
35
  static stringToObjectId(val: any): any;
34
36
  static objectIdToString(val: any): any;
@@ -1 +1 @@
1
- {"version":3,"file":"mongodb-helper.d.ts","sourceRoot":"","sources":["../../../../src/database/mongodb/mongodb-helper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,EAAE,CAAA;gBAEE,EAAE,EAAE,SAAS;IAIzB;;;;;;;;;;;;;;;OAeG;IACU,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAUhE;;OAEG;IACU,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAW5D,QAAQ,CAAC,IAAI,EAAE,MAAM;WAQpB,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG;WAqB/B,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG;CAuB9C"}
1
+ {"version":3,"file":"mongodb-helper.d.ts","sourceRoot":"","sources":["../../../../src/database/mongodb/mongodb-helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAY,MAAM,SAAS,CAAA;AAE5E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,EAAE,CAAA;gBAEE,EAAE,EAAE,SAAS;IAIzB;;;;;;;;;;;;;;;OAeG;IACU,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAUhE;;OAEG;IACU,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAW5D,WAAW,CACtB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,kBAAkB,EACxB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,IAAI,CAAC;IAIH,QAAQ,CAAC,IAAI,EAAE,MAAM;WAQpB,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG;WAqB/B,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG;CAuB9C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@point-hub/papi",
3
- "version": "0.5.19",
3
+ "version": "0.5.20",
4
4
  "description": "Point API Framework",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",