c2-mongoose 2.1.178 → 2.1.180

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.
@@ -1,6 +1,7 @@
1
1
  import mongoose, { ClientSession } from "mongoose";
2
2
  import { SearchOptions, SearchResponse } from "../types/SearchResponse";
3
3
  declare abstract class SearchFlow {
4
+ [key: string]: any;
4
5
  searchText: string;
5
6
  orderSense: string;
6
7
  orderBy: string;
@@ -438,11 +438,27 @@ var SearchFlow = /** @class */ (function () {
438
438
  SearchFlow.prototype.buildDefaultFilters = function (objectSearch) {
439
439
  var _this = this;
440
440
  var filters = { $and: [] };
441
- Object.entries(objectSearch.model).forEach(function (_a) {
441
+ Object.entries(objectSearch).forEach(function (_a) {
442
442
  var key = _a[0], value = _a[1];
443
443
  if ((0, Utils_1.isNotEmpty)(value)) {
444
444
  var condition = {};
445
- if (['onlyMetadata', 'projection', 'pageable', 'orderSense', 'orderBy', 'properties', 'populate', 'page', 'limit', 'model', 'select', 'searchText', 'isPageable', 'searchPageable'].includes(key)) {
445
+ if ([
446
+ 'onlyMetadata',
447
+ 'projection',
448
+ 'pageable',
449
+ 'orderSense',
450
+ 'orderBy',
451
+ 'properties',
452
+ 'populate',
453
+ 'page',
454
+ 'limit',
455
+ 'model',
456
+ 'select',
457
+ 'searchText',
458
+ 'sort',
459
+ 'isPageable',
460
+ 'searchPageable'
461
+ ].includes(key)) {
446
462
  return;
447
463
  }
448
464
  if (typeof value === 'string' && _this.isValidObjectId(value)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.178",
3
+ "version": "2.1.180",
4
4
  "description": "Lib to make any search in database mongoose and use as basic crud",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -4,6 +4,7 @@ import { SearchOptions, SearchResponse } from "../types/SearchResponse"
4
4
  import { isEmpty, isNotEmpty } from "../utils/Utils"
5
5
 
6
6
  abstract class SearchFlow {
7
+ [key: string]: any
7
8
  searchText: string
8
9
  orderSense: string
9
10
  orderBy: string
@@ -378,10 +379,25 @@ abstract class SearchFlow {
378
379
 
379
380
  public buildDefaultFilters(objectSearch: any) {
380
381
  let filters = { $and: [] } as any
381
- Object.entries(objectSearch.model).forEach(([key, value]) => {
382
+ Object.entries(objectSearch).forEach(([key, value]) => {
382
383
  if (isNotEmpty(value)) {
383
384
  let condition = {} as any
384
- if (['onlyMetadata', 'projection', 'pageable', 'orderSense', 'orderBy', 'properties', 'populate', 'page', 'limit', 'model', 'select', 'searchText', 'isPageable', 'searchPageable'].includes(key)) {
385
+ if ([
386
+ 'onlyMetadata',
387
+ 'projection',
388
+ 'pageable',
389
+ 'orderSense',
390
+ 'orderBy',
391
+ 'properties',
392
+ 'populate',
393
+ 'page',
394
+ 'limit',
395
+ 'model',
396
+ 'select',
397
+ 'searchText',
398
+ 'sort',
399
+ 'isPageable',
400
+ 'searchPageable'].includes(key)) {
385
401
  return
386
402
  }
387
403