File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -144,8 +144,11 @@ UserTC.addRelation(
144
144
resolver: UserTC .get (' $findMany' ), // shortand for `UserTC.getResolver('findMany')`
145
145
args: { // resolver `findMany` has `filter` arg, we may provide mongoose query to it
146
146
filter : (source ) => ({
147
- _id: { $in: source .friendsIds },
148
- age: { $gt: 21 },
147
+ _operators : { // Applying criteria on fields which have
148
+ // operators enabled for them (by default, indexed fields only)
149
+ _id : { in: source .friendsIds },
150
+ age: { gt: 21 }
151
+ },
149
152
gender: source .gender ,
150
153
}),
151
154
limit: 10 ,
@@ -258,6 +261,7 @@ export type filterHelperArgsOpts = {
258
261
onlyIndexed ?: boolean , // leave only that fields, which is indexed in mongodb
259
262
requiredFields ?: string | string [], // provide fieldNames, that should be required
260
263
operators ?: filterOperatorsOpts | false , // provide filtering fields by operators, eg. $lt, $gt
264
+ // if left empty - provides all oeprators on indexed fields
261
265
};
262
266
263
267
// supported operators names in filter `arg`
You can’t perform that action at this time.
0 commit comments