Filterable nested object in mongoose
iamkhalidbashir opened this issue · 9 comments
iamkhalidbashir commented
I could not find a way to make a property filterable for a sub-object of mongoose document. Only root properties seems to be filterable
TriPSs commented
Sub objects that can be filtered need to be defined with FilterableRelation
for example, think in Mongoose this is maybe not always a actual relation but you can try that.
iamkhalidbashir commented
TriPSs commented
No, that is probably correct.
I do not use mongoose so I do not know those parts.
smolinari commented
Using dot notation didn't work?
Scott
iamkhalidbashir commented
Yes it did work, thanks.
TriPSs commented
Going to close this issue as it's resolved.
iamkhalidbashir commented
Actually its giving this error when call api call
Looks like it could not find a reference model, but there should be no reference model to search for as its a sub object
Error: Unable to lookup reference type for template"
1
:
" at MongooseQueryService.getReferenceModel (/home/node/app/packages/query-mongoose/src/services/reference-query.service.ts:339:11)"
2
:
" at MongooseQueryService.getReferenceQueryBuilder (/home/node/app/packages/query-mongoose/src/services/reference-query.service.ts:320:45)"
3
:
" at MongooseQueryService.findRelation (/home/node/app/packages/query-mongoose/src/services/reference-query.service.ts:138:40)"
4
:
" at /home/node/app/packages/query-graphql/src/loader/find-relations.loader.ts:34:47"
iamkhalidbashir commented
iamkhalidbashir commented