File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -144,8 +144,11 @@ UserTC.addRelation(
144144 resolver: UserTC .get (' $findMany' ), // shortand for `UserTC.getResolver('findMany')`
145145 args: { // resolver `findMany` has `filter` arg, we may provide mongoose query to it
146146 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+ },
149152 gender: source .gender ,
150153 }),
151154 limit: 10 ,
@@ -258,6 +261,7 @@ export type filterHelperArgsOpts = {
258261 onlyIndexed ?: boolean , // leave only that fields, which is indexed in mongodb
259262 requiredFields ?: string | string [], // provide fieldNames, that should be required
260263 operators ?: filterOperatorsOpts | false , // provide filtering fields by operators, eg. $lt, $gt
264+ // if left empty - provides all oeprators on indexed fields
261265};
262266
263267// supported operators names in filter `arg`
You can’t perform that action at this time.
0 commit comments