c2-mongoose 2.1.280 → 2.1.281

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.
@@ -304,7 +304,7 @@ var SearcherFlow = /** @class */ (function () {
304
304
  var _this = this;
305
305
  // Recuperar todos os campos do tipo String
306
306
  var camposString = (0, Utils_1.isEmpty)(this.searchTextFields) ? this.extractFieldsOfType(this.model.schema, 'String') : this.searchTextFields;
307
- var filters = { $and: [] };
307
+ var filters = { $and: [], $or: [] };
308
308
  Object.entries(objectSearch).forEach(function (_a) {
309
309
  var key = _a[0], value = _a[1];
310
310
  if ((0, Utils_1.isNotEmpty)(value) || value === null) {
@@ -360,7 +360,6 @@ var SearcherFlow = /** @class */ (function () {
360
360
  if (objectSearch === null || objectSearch === void 0 ? void 0 : objectSearch.or) {
361
361
  Object.entries(objectSearch === null || objectSearch === void 0 ? void 0 : objectSearch.or).forEach(function (_a) {
362
362
  var key = _a[0], value = _a[1];
363
- console.log(key, value);
364
363
  if ((0, Utils_1.isEmpty)(value))
365
364
  return;
366
365
  if (typeof value === 'string' && _this.isValidObjectId(value) && key !== 'owner') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.280",
3
+ "version": "2.1.281",
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",
@@ -285,7 +285,7 @@ class SearcherFlow<D> {
285
285
  const camposString = isEmpty(this.searchTextFields) ? this.extractFieldsOfType(this.model.schema, 'String') : this.searchTextFields
286
286
 
287
287
 
288
- let filters = { $and: [] } as any
288
+ let filters = { $and: [], $or: [] } as any
289
289
  Object.entries(objectSearch).forEach(([key, value]) => {
290
290
  if (isNotEmpty(value) || value === null) {
291
291
  if ([
@@ -345,7 +345,6 @@ class SearcherFlow<D> {
345
345
 
346
346
  if (objectSearch?.or) {
347
347
  Object.entries(objectSearch?.or).forEach(([key, value]) => {
348
- console.log(key, value)
349
348
  if (isEmpty(value)) return
350
349
 
351
350
  if (typeof value === 'string' && this.isValidObjectId(value as string) && key !== 'owner') {