@bprotsyk/aso-core 1.2.58 → 1.2.60
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/flash/flash-app.js +20 -16
- package/package.json +1 -1
- package/src/flash/flash-app.ts +33 -28
package/lib/flash/flash-app.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateSchemaAndMoveValue = exports.FlashAppSchema = exports.PlugType = void 0;
|
|
4
4
|
const flash_app_type_1 = require("./flash-app-type");
|
|
5
5
|
const mongoose_1 = require("mongoose");
|
|
6
|
+
const util = require("util");
|
|
6
7
|
var PlugType;
|
|
7
8
|
(function (PlugType) {
|
|
8
9
|
PlugType["PASTEBIN"] = "PASTEBIN";
|
|
@@ -149,22 +150,22 @@ exports.FlashAppSchema = new mongoose_1.Schema({
|
|
|
149
150
|
});
|
|
150
151
|
// TODO app type (casino / fin)
|
|
151
152
|
async function updateSchemaAndMoveValue(model) {
|
|
152
|
-
await model.syncIndexes()
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
153
|
+
// await model.syncIndexes()
|
|
154
|
+
let pipelineStage = [
|
|
155
|
+
{
|
|
156
|
+
// $set: {
|
|
157
|
+
// city: "$employee_addr.city",
|
|
158
|
+
// street: "$employee_addr.street",
|
|
159
|
+
// apartment: "$employee_addr.apartment",
|
|
160
|
+
// employee_addr: "$$REMOVE"
|
|
161
|
+
// },
|
|
162
|
+
$set: {
|
|
163
|
+
"generationOptions.keyDeveloperName": "$$REMOVE",
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
];
|
|
167
|
+
let aggregation = model.aggregate(pipelineStage);
|
|
168
|
+
await aggregation.exec();
|
|
168
169
|
// const updateOperation: UpdateQuery<IFlashApp> = {
|
|
169
170
|
// $set: {
|
|
170
171
|
// pushesEnabled: true,
|
|
@@ -199,5 +200,8 @@ async function updateSchemaAndMoveValue(model) {
|
|
|
199
200
|
// ],
|
|
200
201
|
// };
|
|
201
202
|
// 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 }));
|
|
202
206
|
}
|
|
203
207
|
exports.updateSchemaAndMoveValue = updateSchemaAndMoveValue;
|
package/package.json
CHANGED
package/src/flash/flash-app.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FlashAppType } from "./flash-app-type";
|
|
2
2
|
import mongoose, { Model, model, PipelineStage, Schema, UpdateQuery, UpdateWithAggregationPipeline } from "mongoose";
|
|
3
|
+
const util = require("util")
|
|
3
4
|
|
|
4
5
|
export interface IFlashApp {
|
|
5
6
|
id: number
|
|
@@ -200,24 +201,24 @@ export const FlashAppSchema = new Schema({
|
|
|
200
201
|
})
|
|
201
202
|
// TODO app type (casino / fin)
|
|
202
203
|
export async function updateSchemaAndMoveValue(model: Model<IFlashApp>): Promise<void> {
|
|
203
|
-
await model.syncIndexes()
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
204
|
+
// await model.syncIndexes()
|
|
205
|
+
let pipelineStage: PipelineStage[] = [
|
|
206
|
+
{
|
|
207
|
+
// $set: {
|
|
208
|
+
// city: "$employee_addr.city",
|
|
209
|
+
// street: "$employee_addr.street",
|
|
210
|
+
// apartment: "$employee_addr.apartment",
|
|
211
|
+
// employee_addr: "$$REMOVE"
|
|
212
|
+
// },
|
|
213
|
+
$set: {
|
|
214
|
+
"generationOptions.keyDeveloperName": "$$REMOVE",
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
]
|
|
217
218
|
|
|
218
|
-
|
|
219
|
+
let aggregation = model.aggregate(pipelineStage)
|
|
219
220
|
|
|
220
|
-
|
|
221
|
+
await aggregation.exec()
|
|
221
222
|
|
|
222
223
|
// const updateOperation: UpdateQuery<IFlashApp> = {
|
|
223
224
|
// $set: {
|
|
@@ -241,19 +242,23 @@ export async function updateSchemaAndMoveValue(model: Model<IFlashApp>): Promise
|
|
|
241
242
|
// developerName: "none",
|
|
242
243
|
// type: FlashAppType.GAMBLING
|
|
243
244
|
// },
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
245
|
+
// $addToSet
|
|
246
|
+
// $unset: [
|
|
247
|
+
// "pastebinUrl",
|
|
248
|
+
// "email",
|
|
249
|
+
// "generationOptions.keyFileName",
|
|
250
|
+
// "generationOptions.keyDeveloperName",
|
|
251
|
+
// "generationOptions.keyDeveloperOrganization",
|
|
252
|
+
// "generationOptions.keyCountryCode",
|
|
253
|
+
// "generationOptions.keyCity",
|
|
254
|
+
// "generationOptions.keyAlias",
|
|
255
|
+
// "generationOptions.keyPassword",
|
|
256
|
+
// ],
|
|
256
257
|
// };
|
|
257
258
|
|
|
258
259
|
// await model.updateMany({}, updateOperation);
|
|
260
|
+
|
|
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 }))
|
|
259
264
|
}
|