@futdevpro/nts-dynamo 1.5.53 → 1.5.54

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.
@@ -3,6 +3,7 @@ import { Dynamo_Metadata, DynamoNTS_DataParams, DynamoNTS_DataPropertyParams, Dy
3
3
 
4
4
  import { DynamoNTS_DBService } from './dynamo-nts-db.service';
5
5
  import { DynamoNTS_GlobalService } from './dynamo-nts-global.service';
6
+ import { DynamoNTS_Shared } from './dynamo-nts-shared.service';
6
7
 
7
8
  /**
8
9
  * Basic Data Service that is connected to the relevant DBServices
@@ -27,13 +28,12 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
27
28
  dataDBService: DynamoNTS_DBService<T>;
28
29
  data: T;
29
30
  dataList: T[] = [];
30
- issuer?: string;
31
+ issuer: string;
31
32
 
32
33
  depKey?: string;
33
34
  depDBServiceKey?: string;
34
35
  private depDataDBService: DynamoNTS_DBService<any>;
35
36
 
36
- // dataModelParams?: DynamoBEDataPropertyParams[] = [];
37
37
  dataParams: DynamoNTS_DataParams;
38
38
 
39
39
  defaultErrorUserMsg = 'We encountered an unhandled Data Error, please contact the responsible development team.';
@@ -42,12 +42,11 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
42
42
  constructor(
43
43
  data: T,
44
44
  dataParams: DynamoNTS_DataParams,
45
- issuer?: string,
45
+ issuer: string,
46
46
  ) {
47
47
  this.dataDBService = DynamoNTS_GlobalService.getDBService<T>(dataParams);
48
48
  this.data = data;
49
49
  this.dataParams = dataParams;
50
- // this.dataModelParams = dataParams.modelParams;
51
50
  this.lookForDependencyDataSettings();
52
51
  this.issuer = issuer;
53
52
  }
@@ -57,7 +56,14 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
57
56
  */
58
57
  async getAll(): Promise<void> {
59
58
  try {
60
- this.dataList = await this.dataDBService.getAll();
59
+ this.dataList = await this.dataDBService.getAll().catch(error => {
60
+ if (error?.errorCodes?.includes('NTS-DBS-GA1')) {
61
+ console.error(error);
62
+ return [];
63
+ } else {
64
+ throw error;
65
+ }
66
+ });
61
67
  } catch (error) {
62
68
  throw new Dynamo_Error({
63
69
  status: 417,
@@ -74,7 +80,7 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
74
80
  * @description
75
81
  * returns data from database by id
76
82
  * also if dontSetToService is false or not setted,
77
- * the data will be saved to the service
83
+ * the data will be saved to the service, even if its not found
78
84
  *
79
85
  * @remarks
80
86
  * If you need to get-save a data, if possible,
@@ -88,8 +94,15 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
88
94
  async getDataById(id?: string, dontSetToService?: boolean): Promise<T> {
89
95
  try {
90
96
  if (id || this.data._id) {
91
- let dataExists: T = await this.dataDBService.getDataById(id ? id : this.data._id);
92
- if (!dontSetToService && dataExists) {
97
+ let dataExists: T = await this.dataDBService.getDataById(id ? id : this.data._id).catch(error => {
98
+ if (error?.errorCodes?.includes('NTS-DBS-GI1')) {
99
+ console.error(error);
100
+ return null;
101
+ } else {
102
+ throw error;
103
+ }
104
+ });
105
+ if (!dontSetToService) {
93
106
  this.data = dataExists;
94
107
  }
95
108
  return dataExists;
@@ -122,7 +135,14 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
122
135
  try {
123
136
  if (this.depKey) {
124
137
  if (dependencyId || this.data[this.depKey]) {
125
- let dataExists: T = await this.dataDBService.getDataByDependencyId(dependencyId ? dependencyId : this.data[this.depKey]);
138
+ let dataExists: T = await this.dataDBService.getDataByDependencyId(dependencyId ? dependencyId : this.data[this.depKey]).catch(error => {
139
+ if (error?.errorCodes?.includes('NTS-DBS-GD2')) {
140
+ console.error(error);
141
+ return null;
142
+ } else {
143
+ throw error;
144
+ }
145
+ });
126
146
  if (!dontSetToService && dataExists) {
127
147
  this.data = dataExists;
128
148
  }
@@ -165,7 +185,14 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
165
185
  try {
166
186
  if (this.depKey) {
167
187
  if (dependencyId || this.data[this.depKey]) {
168
- this.dataList = await this.dataDBService.getDataListByDependencyId(dependencyId ? dependencyId : this.data[this.depKey]);
188
+ this.dataList = await this.dataDBService.getDataListByDependencyId(dependencyId ? dependencyId : this.data[this.depKey]).catch(error => {
189
+ if (error?.errorCodes?.includes('NTS-DBS-GLD2')) {
190
+ console.error(error);
191
+ return [];
192
+ } else {
193
+ throw error;
194
+ }
195
+ });
169
196
  } else {
170
197
  throw new Dynamo_Error({
171
198
  status: 417,
@@ -196,10 +223,173 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
196
223
  }
197
224
  }
198
225
 
226
+ /**
227
+ *
228
+ * // findOne desc:
229
+ *
230
+ * Find the data first by any of its parameters,
231
+ * also if dontSetToService is false or not setted,
232
+ * the data will be saved to the service, even if non found
233
+ *
234
+ * @param filter if you can, use unique parameters for find!
235
+ *
236
+ * @example
237
+ * // by email:
238
+ * { email: email }
239
+ * //
240
+ * @example
241
+ * // or by id that is in list:
242
+ * { userIds: { $in: this.userId } }
243
+ * //
244
+ * @example
245
+ * // or by number or Date that is Greater Than AND Less Than:
246
+ * { points: { $gt: 2, $lt: 14 } }
247
+ * // further tools (syntax matches with $gt):
248
+ * $eq: // Matches values that are EQual to a specified value.
249
+ * $gte: // Matches values that are Greater Than OR Equal to a specified value.
250
+ * $lte: // Matches values that are Less Than or Equal to a specified value.
251
+ * $ne: // Matches all values that are Not Equal to a specified value.
252
+ * $nin: // Matches None of the values specified IN an array.
253
+ * //
254
+ * @returns {T} data: T
255
+ */
256
+ async findData(findBy: any, dontSetToService?: boolean): Promise<T> {
257
+ try {
258
+ const dataExists: T = await this.dataDBService.findOne(findBy).catch(error => {
259
+ if (error?.errorCodes?.includes('NTS-DBS-FO1')) {
260
+ console.error(error);
261
+ return null;
262
+ } else {
263
+ throw error;
264
+ }
265
+ });
266
+ if (!dontSetToService) {
267
+ this.data = dataExists;
268
+ }
269
+ return dataExists;
270
+ } catch (error) {
271
+ throw new Dynamo_Error({
272
+ status: 417,
273
+ errorCode: 'NTS-DS0-FD0',
274
+ addECToUserMsg: true,
275
+ message: `findData was unsuccessful (${this.dataParams.dataName})`,
276
+ userMessage: this.defaultErrorUserMsg,
277
+ error: error
278
+ });
279
+ }
280
+ }
281
+
282
+ /**
283
+ *
284
+ * // find desc:
285
+ *
286
+ * Find the data first by any of its parameters,
287
+ * also if dontSetToService is false or not setted,
288
+ * the data will be saved to the service, even if non found
289
+ *
290
+ * @param filter if you can, use unique parameters for find!
291
+ *
292
+ * @example
293
+ * // by email:
294
+ * { email: email }
295
+ * //
296
+ * @example
297
+ * // or by id that is in list:
298
+ * { userIds: { $in: this.userId } }
299
+ * //
300
+ * @example
301
+ * // or by number or Date that is Greater Than AND Less Than:
302
+ * { points: { $gt: 2, $lt: 14 } }
303
+ * // further tools (syntax matches with $gt):
304
+ * $eq: // Matches values that are EQual to a specified value.
305
+ * $gte: // Matches values that are Greater Than OR Equal to a specified value.
306
+ * $lte: // Matches values that are Less Than or Equal to a specified value.
307
+ * $ne: // Matches all values that are Not Equal to a specified value.
308
+ * $nin: // Matches None of the values specified IN an array.
309
+ * //
310
+ * @returns {T[]} dataList: T[]
311
+ */
312
+ async findDatas(findBy: any, dontSetToService?: boolean): Promise<T[]> {
313
+ try {
314
+ const dataListExists: T[] = await this.dataDBService.find(findBy).catch(error => {
315
+ if (error?.errorCodes?.includes('NTS-DBS-F1')) {
316
+ console.error(error);
317
+ return [];
318
+ } else {
319
+ throw error;
320
+ }
321
+ });
322
+ if (!dontSetToService) {
323
+ this.dataList = dataListExists;
324
+ }
325
+ return dataListExists;
326
+ } catch (error) {
327
+ throw new Dynamo_Error({
328
+ status: 417,
329
+ errorCode: 'NTS-DS0-FDS0',
330
+ addECToUserMsg: true,
331
+ message: `findDatas was unsuccessful (${this.dataParams.dataName})`,
332
+ userMessage: this.defaultErrorUserMsg,
333
+ error: error
334
+ });
335
+ }
336
+ }
337
+
199
338
  /**
200
339
  * This function uses the dataDBService.updateOne function.
201
340
  * This uses updateBy if setted, or data._id if its setted or this.data[this.dependencyKey]
202
341
  * @param set
342
+ *
343
+ * // updateOne desc:
344
+ *
345
+ * Find the data first by any of its parameters, throws error if not found
346
+ * @param filter This uses the basic Mongoose updateOne.
347
+ * If you can, use unique parameters for find!
348
+ * @example
349
+ * // by email:
350
+ * { email: email }
351
+ * //
352
+ * @example
353
+ * // or by id that is in list:
354
+ * { userIds: { $in: this.userId } }
355
+ * //
356
+ * @example
357
+ * // or by number or Date that is Greater Than AND Less Than:
358
+ * { points: { $gt: 2, $lt: 14 } }
359
+ * // further tools (syntax matches with $gt):
360
+ * $eq: // Matches values that are EQual to a specified value.
361
+ * $gte: // Matches values that are Greater Than OR Equal to a specified value.
362
+ * $lte: // Matches values that are Less Than or Equal to a specified value.
363
+ * $ne: // Matches all values that are Not Equal to a specified value.
364
+ * $nin: // Matches None of the values specified IN an array.
365
+ * //
366
+ *
367
+ * @param update this uses the basic Mongoose updateOne
368
+ * @example
369
+ * // increase a specific value (here by 15):
370
+ * { $inc: { popularity: 15 } }
371
+ * //
372
+ * @example
373
+ * // or add element to a list:
374
+ * { $push: { reactions: this.newReaction }
375
+ * // or add multiple elements to a list
376
+ * { $push: { schedule: {$each: [ monday, tuesday, wednesday ] } } }
377
+ * //
378
+ * @example
379
+ * // or all at once
380
+ * {
381
+ * $inc: { popularity: this.newVote.amount },
382
+ * emailVerified: true,
383
+ * $push: { reactions: this.newReaction }
384
+ * }
385
+ * // further tools (syntax matches with $inc):
386
+ * $currentDate: // Sets the value of a field to current date, either as a Date or a Timestamp.
387
+ * $min: // Only updates the field if the specified value is less than the existing field value.
388
+ * $max: // Only updates the field if the specified value is greater than the existing field value.
389
+ * $mul: // Multiplies the value of the field by the specified amount.
390
+ * $rename: // Renames a field.
391
+ * $unset: // Removes the specified field from a document. (set: "" to value)
392
+ * //
203
393
  */
204
394
  async updateData(set: { updateBy?: any, update: any }): Promise<void> {
205
395
  try {
@@ -234,6 +424,7 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
234
424
  * modifies data if the data have ID and already exists in the DB,
235
425
  * creates new if the ID is not present or cant find in DB,
236
426
  * and if dependency data setted up, will check before creation,
427
+ *
237
428
  * @warning
238
429
  * but the proper way to update data, if you use update method instead,
239
430
  * this way, you can avoid data override errors
@@ -244,7 +435,7 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
244
435
  try {
245
436
  if (this.data._id) {
246
437
  // check if already exists
247
- let dataExists: T = await this.getDataById(null, true).catch(() => null);
438
+ const dataExists: T = await this.getDataById(null, true);
248
439
  if (dataExists) {
249
440
  // if data exists do modify
250
441
  this.data = await this.dataDBService.modifyData(this.data, this.issuer);
@@ -261,7 +452,14 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
261
452
  });
262
453
  }
263
454
 
264
- let dependencyExists = await this.getDependencyDataDBService().getDataById(this.data[this.depKey]);
455
+ let dependencyExists = await this.getDependencyDataDBService().getDataById(this.data[this.depKey]).catch(error => {
456
+ if (error?.errorCodes?.includes('NTS-DBS-GI1')) {
457
+ console.error(error);
458
+ return null;
459
+ } else {
460
+ throw error;
461
+ }
462
+ });
265
463
  if (!dependencyExists) {
266
464
  throw new Dynamo_Error({
267
465
  status: 417,
@@ -112,7 +112,8 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
112
112
  }
113
113
 
114
114
  /**
115
- * returns data by _id, throws error if not found
115
+ * returns data by _id,
116
+ * !!!: throws error if not found (errorCode on not found: NTS-DBS-GI1)
116
117
  * @param id id
117
118
  * @returns data
118
119
  */
@@ -121,7 +122,14 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
121
122
  if (res) {
122
123
  return res.toObject() as T;
123
124
  } else {
124
- return null;
125
+ /* return null; */
126
+ throw new Dynamo_Error({
127
+ status: 417,
128
+ errorCode: 'NTS-DBS-GI1',
129
+ addECToUserMsg: true,
130
+ message: `get ${this.dataParams.dbName} by ID was unsuccessful: data not found by id: ${id} (NTS DB)`,
131
+ userMessage: this.defaultErrorUserMsg
132
+ });
125
133
  }
126
134
  }).catch(error => {
127
135
  throw new Dynamo_Error({
@@ -142,7 +150,9 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
142
150
  }
143
151
 
144
152
  /**
145
- * get data by dependency data id, throws error if not found
153
+ * get data by dependency data id,
154
+ * !!!: throws error if not found (errorCode on not found: NTS-DBS-GD2)
155
+ *
146
156
  * @param dependencyId id
147
157
  * @returns data
148
158
  */
@@ -161,7 +171,14 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
161
171
  if (res) {
162
172
  return res.toObject() as T;
163
173
  } else {
164
- return null;
174
+ /* return null; */
175
+ throw new Dynamo_Error({
176
+ status: 417,
177
+ errorCode: 'NTS-DBS-GD2',
178
+ addECToUserMsg: true,
179
+ message: `get ${this.dataParams.dbName} by ${this.depDataName} was unsuccessful: data not found by id: ${dependencyId} (NTS DB)`,
180
+ userMessage: this.defaultErrorUserMsg
181
+ });
165
182
  }
166
183
  }).catch(error => {
167
184
  throw new Dynamo_Error({
@@ -182,7 +199,9 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
182
199
  }
183
200
 
184
201
  /**
185
- * get data by dependency data id, throws error if not found
202
+ * get data by dependency data id,
203
+ * !!!: throws error if not found (errorCode on not found: NTS-DBS-GLD2)
204
+ *
186
205
  * @param dependencyId id
187
206
  * @returns dataList
188
207
  */
@@ -198,8 +217,20 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
198
217
  }
199
218
 
200
219
  let dataList: T[] = await this.dataModel.find({ [this.depDataName]: dependencyId })
201
- .then(res => res ?? [])
202
- .catch(error => {
220
+ .then(res => {
221
+ if (res) {
222
+ return res as T[];
223
+ } else {
224
+ /* return []; */
225
+ throw new Dynamo_Error({
226
+ status: 417,
227
+ errorCode: 'NTS-DBS-GLD2',
228
+ addECToUserMsg: true,
229
+ message: `get ${this.dataParams.dbName} by ${this.depDataName} was unsuccessful: no data found by id: ${dependencyId} (NTS DB)`,
230
+ userMessage: this.defaultErrorUserMsg
231
+ });
232
+ }
233
+ }).catch(error => {
203
234
  throw new Dynamo_Error({
204
235
  status: 417,
205
236
  errorCode: 'NTS-DBS-GLD1',
@@ -222,7 +253,9 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
222
253
  }
223
254
 
224
255
  /**
225
- * get multiple data objects by a list of DependencyIDs, throws error if not found
256
+ * get multiple data objects by a list of DependencyIDs,
257
+ * !!!: throws error if not found (errorCode on not found: NTS-DBS-GLDS2)
258
+ *
226
259
  * @param ids ids
227
260
  * @returns dataList
228
261
  */
@@ -238,8 +271,20 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
238
271
  }
239
272
 
240
273
  let dataList: T[] = await this.dataModel.find({ [this.depDataName]: { $in: ids }})
241
- .then(res => res ?? [])
242
- .catch(error => {
274
+ .then(res => {
275
+ if (res) {
276
+ return res as T[];
277
+ } else {
278
+ /* return []; */
279
+ throw new Dynamo_Error({
280
+ status: 417,
281
+ errorCode: 'NTS-DBS-GLDS2',
282
+ addECToUserMsg: true,
283
+ message: `get ${this.dataParams.dbName} by ${this.depDataName} was unsuccessful: no data found by ids: ${ids} (NTS DB)`,
284
+ userMessage: this.defaultErrorUserMsg
285
+ });
286
+ }
287
+ }).catch(error => {
243
288
  throw new Dynamo_Error({
244
289
  status: 417,
245
290
  errorCode: 'NTS-DBS-GLDS1',
@@ -264,6 +309,7 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
264
309
  /**
265
310
  * returns search result for searchBy object params
266
311
  * can use lists or xRange values for searchBy obj properties
312
+ *
267
313
  * @param searchBy filter
268
314
  * @param narrowByDependencyIds id
269
315
  * @returns dataList
@@ -357,13 +403,27 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
357
403
  }
358
404
 
359
405
  /**
360
- * returns all data from database, throws error if not found
406
+ * returns all data from database,
407
+ * !!!: throws error if not found (errorCode on not found: NTS-DBS-GA1)
408
+ *
361
409
  * @returns dataList
362
410
  */
363
411
  async getAll(): Promise<T[]> {
364
412
  let dataList: T[] = await this.dataModel.find({})
365
- .then(res => res ?? [])
366
- .catch(error => {
413
+ .then(res => {
414
+ if (res) {
415
+ return res as T[];
416
+ } else {
417
+ /* return null; */
418
+ throw new Dynamo_Error({
419
+ status: 417,
420
+ errorCode: 'NTS-DBS-GA1',
421
+ addECToUserMsg: true,
422
+ message: `get all ${this.dataParams.dbName} was unsuccessful: no data found (NTS DB)`,
423
+ userMessage: this.defaultErrorUserMsg
424
+ });
425
+ }
426
+ }).catch(error => {
367
427
  throw new Dynamo_Error({
368
428
  status: 417,
369
429
  errorCode: 'NTS-DBS-GA0',
@@ -434,7 +494,9 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
434
494
  // DIRECT Basic MONGOOSE FUNCTIONS (with error handlings)
435
495
 
436
496
  /**
437
- * Find the data first by any of its parameters, throws error if not found
497
+ * Find the data first by any of its parameters,
498
+ * !!!: throws error if not found (errorCode on not found: NTS-DBS-FO1)
499
+ *
438
500
  * @param filter if you can, use unique parameters for find!
439
501
  *
440
502
  * @example
@@ -460,16 +522,23 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
460
522
  async findOne(filter: any): Promise<T> {
461
523
  let data: T = await this.dataModel.findOne(filter).then(res => {
462
524
  if (res) {
463
- return res.toObject() as T;
525
+ return res as T;
464
526
  } else {
465
- return null;
527
+ /* return null; */
528
+ throw new Dynamo_Error({
529
+ status: 417,
530
+ errorCode: 'NTS-DBS-FO1',
531
+ addECToUserMsg: true,
532
+ message: `findOne ${this.dataParams.dbName} was unsuccessful, no data found (NTS DB) fliter: ${filter}`,
533
+ userMessage: this.defaultErrorUserMsg
534
+ });
466
535
  }
467
536
  }).catch(error => {
468
537
  throw new Dynamo_Error({
469
538
  status: 417,
470
539
  errorCode: 'NTS-DBS-FO0',
471
540
  addECToUserMsg: true,
472
- message: `findOne ${this.dataParams.dbName} was unsuccessful (NTS DB)`,
541
+ message: `findOne ${this.dataParams.dbName} was unsuccessful (NTS DB) fliter: ${filter}`,
473
542
  userMessage: this.defaultErrorUserMsg,
474
543
  error
475
544
  });
@@ -484,7 +553,9 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
484
553
 
485
554
  /**
486
555
  * #MONGOOSE FUNCTION
487
- * Find the data first by any of its parameters, throws error if not found
556
+ * Find the data first by any of its parameters,
557
+ * !!!: throws error if not found (errorCode on not found: NTS-DBS-F1)
558
+ *
488
559
  * @param filter if you can, use unique parameters for find!
489
560
  *
490
561
  * @example
@@ -509,8 +580,20 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
509
580
  */
510
581
  async find(filter: any): Promise<T[]> {
511
582
  let dataList: T[] = await this.dataModel.find(filter)
512
- .then(res => res ?? [])
513
- .catch(error => {
583
+ .then(res => {
584
+ if (res) {
585
+ return res as T[];
586
+ } else {
587
+ /* return null; */
588
+ throw new Dynamo_Error({
589
+ status: 417,
590
+ errorCode: 'NTS-DBS-F1',
591
+ addECToUserMsg: true,
592
+ message: `find ${this.dataParams.dbName} was unsuccessful, no data found (NTS DB) fliter: ${filter}`,
593
+ userMessage: this.defaultErrorUserMsg
594
+ });
595
+ }
596
+ }).catch(error => {
514
597
  throw new Dynamo_Error({
515
598
  status: 417,
516
599
  errorCode: 'NTS-DBS-F0',
@@ -534,7 +617,8 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
534
617
 
535
618
  /**
536
619
  * #MONGOOSE FUNCTION
537
- * Find the data first by any of its parameters, throws error if not found
620
+ * Find the data first by any of its parameters
621
+ *
538
622
  * @param filter if you can, use unique parameters for find!
539
623
  *
540
624
  * @example
@@ -595,6 +679,8 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
595
679
  /**
596
680
  * #MONGOOSE FUNCTION
597
681
  * Find data by _id and update
682
+ * !!!: throws error if not found (errorCode on not found: )
683
+ *
598
684
  * @param id id
599
685
  * @param update update
600
686
  * @returns data
@@ -635,7 +721,8 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
635
721
 
636
722
  /**
637
723
  * #MONGOOSE FUNCTION
638
- * Find the data first by any of its parameters, throws error if not found
724
+ * Find the data first by any of its parameters
725
+ *
639
726
  * @param filter This uses the basic Mongoose updateOne.
640
727
  * If you can, use unique parameters for find!
641
728
  * @example
@@ -704,6 +791,7 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
704
791
  /**
705
792
  * #MONGOOSE FUNCTION
706
793
  * update one parameter by a specific
794
+ *
707
795
  * @param filter This uses the basic Mongoose updateMany.
708
796
  * @example
709
797
  * // by email: