c2-mongoose 2.1.129 → 2.1.131

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.
@@ -230,9 +230,6 @@ var SearchFlow = /** @class */ (function () {
230
230
  if ((0, Utils_1.isNotEmpty)(this.projection)) {
231
231
  stagesItems.push({ $project: this.projection });
232
232
  }
233
- if ((0, Utils_1.isNotEmpty)(options.pipelines)) {
234
- stagesItems.push.apply(stagesItems, options.pipelines);
235
- }
236
233
  stagesItems.push({ $sort: this.sort });
237
234
  stagesItems.push({ $skip: ((this.page - 1) * this.limit) || 0 });
238
235
  stagesItems.push({ $limit: this.limit });
@@ -291,7 +288,11 @@ var SearchFlow = /** @class */ (function () {
291
288
  var transformedObject = {};
292
289
  for (var key in originalObject) {
293
290
  if (key.startsWith('metadata-')) {
294
- metadata[key.replace("metadata-", "")] = originalObject[key][0];
291
+ if (originalObject[key].length === 1) {
292
+ metadata[key.replace("metadata-", "")] = originalObject[key][0];
293
+ continue;
294
+ }
295
+ metadata[key.replace("metadata-", "")] = originalObject[key];
295
296
  }
296
297
  else {
297
298
  transformedObject[key] = originalObject[key];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.129",
3
+ "version": "2.1.131",
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",
@@ -193,10 +193,6 @@ abstract class SearchFlow {
193
193
  stagesItems.push({ $project: this.projection })
194
194
  }
195
195
 
196
- if (isNotEmpty(options.pipelines)) {
197
- stagesItems.push(...options.pipelines)
198
- }
199
-
200
196
  stagesItems.push({ $sort: this.sort })
201
197
  stagesItems.push({ $skip: ((this.page - 1) * this.limit) || 0 })
202
198
  stagesItems.push({ $limit: this.limit })
@@ -257,7 +253,11 @@ abstract class SearchFlow {
257
253
 
258
254
  for (const key in originalObject) {
259
255
  if (key.startsWith('metadata-')) {
260
- metadata[key.replace("metadata-", "")] = originalObject[key][0];
256
+ if (originalObject[key].length === 1) {
257
+ metadata[key.replace("metadata-", "")] = originalObject[key][0]
258
+ continue
259
+ }
260
+ metadata[key.replace("metadata-", "")] = originalObject[key]
261
261
  } else {
262
262
  transformedObject[key] = originalObject[key];
263
263
  }