@vasrefil/api-toolkit 1.11.1 → 1.11.2

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.
@@ -11,7 +11,7 @@ export declare class RootController {
11
11
  getDocumentCount: (conditon?: {}, query?: object) => Promise<number>;
12
12
  create: (payload: any) => Promise<any>;
13
13
  createSes: (payload: any, session: ClientSession) => Promise<any>;
14
- fetchAll(condition?: object, query?: FetchAllQuery, select?: string | object, populate?: any): import("mongoose").Query<Omit<any, never>[], any, {}, any>;
14
+ fetchAll(condition?: object, query?: FetchAllQuery, select?: string | object, populate?: any): import("mongoose").Query<import("mongoose").LeanDocument<Omit<any, never>>[] | import("mongoose").LeanDocument<any>[], any, {}, any>;
15
15
  fetchAllWithPagination: (conditon: object, query?: FetchAllQuery, select?: string | object, populate?: ModelPopulateI[]) => Promise<FetchWithPaginationDataI>;
16
16
  getOneP: (condition: object, select?: any) => Promise<any>;
17
17
  getOne(condition: any, select?: any, populate?: any): import("mongoose").Query<any, any, {}, any>;
@@ -142,7 +142,13 @@ class RootController {
142
142
  }
143
143
  fetchAll(condition = {}, query, select = '', populate) {
144
144
  const { filter, skip, limit, sort } = query_helper_1.QueryHelper.build_query(query);
145
- return this.model.find({ ...filter, ...condition }).select(select).skip(skip).limit(limit).sort(sort).populate(populate);
145
+ return this.model.find({ ...filter, ...condition })
146
+ .select(select)
147
+ .sort(sort)
148
+ .skip(skip)
149
+ .limit(limit)
150
+ .populate(populate)
151
+ .lean();
146
152
  }
147
153
  getOne(condition, select, populate) {
148
154
  select = select ? select : '';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vasrefil/api-toolkit",
3
3
  "description": "This is Vasrefil API toolkit",
4
- "version": "1.11.1",
4
+ "version": "1.11.2",
5
5
  "author": "Sodiq Alabi",
6
6
  "main": "dist/public-api.js",
7
7
  "types": "dist/public-api.d.ts",