@chevre/domain 21.2.0-alpha.122 → 21.2.0-alpha.123

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.
@@ -122,6 +122,8 @@ export declare class StockHolderRepository {
122
122
  * 汎用的な検索(mongooseのみ対応)
123
123
  */
124
124
  search(params: {
125
+ limit?: number;
126
+ page?: number;
125
127
  project?: {
126
128
  id?: {
127
129
  $eq?: string;
@@ -485,6 +485,11 @@ class StockHolderRepository {
485
485
  }
486
486
  }
487
487
  ]);
488
+ if (typeof params.limit === 'number' && params.limit > 0) {
489
+ const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
490
+ aggregate.limit(params.limit * page)
491
+ .skip(params.limit * (page - 1));
492
+ }
488
493
  return aggregate.exec();
489
494
  });
490
495
  }
package/package.json CHANGED
@@ -117,5 +117,5 @@
117
117
  "postversion": "git push origin --tags",
118
118
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
119
119
  },
120
- "version": "21.2.0-alpha.122"
120
+ "version": "21.2.0-alpha.123"
121
121
  }