Where filter with through many id #9816
Unanswered
shabinsharafi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, i have a model Item
@model()
export class Item extends Entity {
@Property({
type: 'string',
required: true,
})
name: string;
@Property({
type: 'string',
id: true,
generated: true,
})
id?: string;
@Property({
type: 'date',
default: () => new Date(),
jsonSchema: {
format: 'date',
},
})
dateCreated?: string;
@belongsTo(() => Category)
categoryId: string;
@hasmany(() => ItemColor, {through: {model: () => ItemColorMapper, keyTo: 'colorId'}})
colors: ItemColor[];
constructor(data?: Partial) {
super(data);
}
}
i need to filter this item with categoryId and and ItemColor's id (colorId).
i tried with this where filter
{
"and": [
{
"or": [
{
"categoryId": "635d0b785c6f4b1930cefb6b"
}
]
},
{
"or": [
{
"colorId": "64a91e282c1d5122540b4d22"
}
]
}
]
}
but am not getting any results
Beta Was this translation helpful? Give feedback.
All reactions