elseware-nodejs 1.8.4 → 1.8.5

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.
package/dist/index.d.cts CHANGED
@@ -1828,6 +1828,7 @@ interface IQueryOptions<T> {
1828
1828
  sort?: Sort<T>;
1829
1829
  limit?: number;
1830
1830
  skip?: number;
1831
+ populate?: string | string[];
1831
1832
  }
1832
1833
  interface IUpdateQueryOptions {
1833
1834
  new?: boolean;
package/dist/index.d.ts CHANGED
@@ -1828,6 +1828,7 @@ interface IQueryOptions<T> {
1828
1828
  sort?: Sort<T>;
1829
1829
  limit?: number;
1830
1830
  skip?: number;
1831
+ populate?: string | string[];
1831
1832
  }
1832
1833
  interface IUpdateQueryOptions {
1833
1834
  new?: boolean;
package/dist/index.js CHANGED
@@ -5179,6 +5179,15 @@ var BaseMongoRepository = class {
5179
5179
  if (options.sort) query = query.sort(options.sort);
5180
5180
  if (options.limit) query = query.limit(options.limit);
5181
5181
  if (options.skip) query = query.skip(options.skip);
5182
+ if (options.populate) {
5183
+ if (Array.isArray(options.populate)) {
5184
+ options.populate.forEach((p) => {
5185
+ query = query.populate(p);
5186
+ });
5187
+ } else {
5188
+ query = query.populate(options.populate);
5189
+ }
5190
+ }
5182
5191
  return query;
5183
5192
  }
5184
5193
  toPlain(doc) {