@bprotsyk/aso-core 1.2.60 → 1.2.62

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.
@@ -150,7 +150,7 @@ exports.FlashAppSchema = new mongoose_1.Schema({
150
150
  });
151
151
  // TODO app type (casino / fin)
152
152
  async function updateSchemaAndMoveValue(model) {
153
- // await model.syncIndexes()
153
+ await model.syncIndexes();
154
154
  let pipelineStage = [
155
155
  {
156
156
  // $set: {
@@ -165,6 +165,8 @@ async function updateSchemaAndMoveValue(model) {
165
165
  }
166
166
  ];
167
167
  let aggregation = model.aggregate(pipelineStage);
168
+ model.collection.dropIndex("generationOptions.keyDeveloperName_1");
169
+ model.collection.dropIndex("generationOptions.keyPassword_1");
168
170
  await aggregation.exec();
169
171
  // const updateOperation: UpdateQuery<IFlashApp> = {
170
172
  // $set: {
@@ -200,8 +202,5 @@ async function updateSchemaAndMoveValue(model) {
200
202
  // ],
201
203
  // };
202
204
  // await model.updateMany({}, updateOperation);
203
- console.log(util.inspect(await model.collection.indexes(), { showHidden: false, depth: null }));
204
- console.log("–––––––––––––––––");
205
- console.log(util.inspect(model.schema.indexes(), { showHidden: false, depth: null }));
206
205
  }
207
206
  exports.updateSchemaAndMoveValue = updateSchemaAndMoveValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bprotsyk/aso-core",
3
- "version": "1.2.60",
3
+ "version": "1.2.62",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "scripts": {
@@ -201,7 +201,7 @@ export const FlashAppSchema = new Schema({
201
201
  })
202
202
  // TODO app type (casino / fin)
203
203
  export async function updateSchemaAndMoveValue(model: Model<IFlashApp>): Promise<void> {
204
- // await model.syncIndexes()
204
+ await model.syncIndexes()
205
205
  let pipelineStage: PipelineStage[] = [
206
206
  {
207
207
  // $set: {
@@ -217,7 +217,8 @@ export async function updateSchemaAndMoveValue(model: Model<IFlashApp>): Promise
217
217
  ]
218
218
 
219
219
  let aggregation = model.aggregate(pipelineStage)
220
-
220
+ model.collection.dropIndex("generationOptions.keyDeveloperName_1")
221
+ model.collection.dropIndex("generationOptions.keyPassword_1")
221
222
  await aggregation.exec()
222
223
 
223
224
  // const updateOperation: UpdateQuery<IFlashApp> = {
@@ -258,7 +259,5 @@ export async function updateSchemaAndMoveValue(model: Model<IFlashApp>): Promise
258
259
 
259
260
  // await model.updateMany({}, updateOperation);
260
261
 
261
- console.log(util.inspect(await model.collection.indexes(), { showHidden: false, depth: null }))
262
- console.log("–––––––––––––––––")
263
- console.log(util.inspect(model.schema.indexes(), { showHidden: false, depth: null }))
262
+
264
263
  }