c2-mongoose 2.1.409 → 2.1.410

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.
@@ -22,7 +22,7 @@ var BuildConditionSearchTextFlowItem = /** @class */ (function () {
22
22
  var conditionAux_1 = {};
23
23
  conditionAux_1["$expr"] = {
24
24
  "$regexMatch": {
25
- input: { $toString: "$_id" },
25
+ input: { $toString: "$".concat(fieldString) },
26
26
  regex: filters.searchText,
27
27
  options: "i" // (opcional) case insensitive
28
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.409",
3
+ "version": "2.1.410",
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",
@@ -18,7 +18,7 @@ class BuildConditionSearchTextFlowItem {
18
18
  let conditionAux: { [key: string]: any } = {}
19
19
  conditionAux["$expr"] = {
20
20
  "$regexMatch": {
21
- input: { $toString: "$_id" }, // converte ObjectId -> string
21
+ input: { $toString: `$${fieldString}` }, // converte ObjectId -> string
22
22
  regex: filters.searchText, // substring a procurar
23
23
  options: "i" // (opcional) case insensitive
24
24
  }