File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ interface QueryOptions<DocType> {
5959 limit ?: number ;
6060 offset ?: number ;
6161 raw ?: boolean ;
62+ queryParams ?: Record < string , any > ;
6263}
6364
6465
@@ -123,6 +124,10 @@ class Query<ResultType, DocType> {
123124
124125 options ! : QueryOptions < DocType > ;
125126
127+ queryParams ! : (
128+ params : Record < string , any > ,
129+ ) => this;
130+
126131 raw ! : ( ) => this extends Query < infer ResultType , infer ResultDocType >
127132 ? ResultType extends RawResultType < any > ? this : Query < RawResultType < ResultType > , ResultDocType >
128133 : never ;
@@ -255,6 +260,7 @@ Query.prototype.buildParams = function () {
255260 limit : options . limit ,
256261 offset : options . offset ,
257262 } ,
263+ ...options . queryParams ,
258264 } ;
259265} ;
260266
@@ -392,6 +398,13 @@ Query.prototype.offset = function (offset) {
392398 return this ;
393399} ;
394400
401+ Query . prototype . queryParams = function ( params ) {
402+ this . setOptions ( {
403+ queryParams : params ,
404+ } ) ;
405+ return this ;
406+ } ;
407+
395408Query . prototype . raw = function ( ) {
396409 this . setOptions ( {
397410 raw : true ,
You can’t perform that action at this time.
0 commit comments