You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class User {
id: int
name: string
roles: Role[]
}
class Role {
id: int
name: string
users: User[]
}
What i'm looking for is to have ability to select user who has roleA and roleB assigned at the same time: GET /rest/user?filter={exp: 'role.name = $a and role.name=$b', params: {a: 'roleA', b:'roleB'} - it will not work, so i'm looking for a way to define an alias for this magic, something like to (and yes, it could cause extra join): GET /rest/user?include={path:'role', alias: 'r1'}&include={path:'role', alias:'r2'}&filter={exp:'r1.name = $a and r2.name=$b', params: {a:'roleA', b:'roleB'}
Or by using new argument: GET /rest/user?alias={path:'role', name:'r1'}&alias={path:'role', name:'r2'}&filter={exp:'r1.name = $a and r2.name=$b', params: {a:'roleA', b:'roleB'}
The text was updated successfully, but these errors were encountered:
alevshunov
changed the title
Allow to use an alias in include syntax to do a filtration by a relations
Allow to use an alias in include syntax (or via new argument) to do a filtration by a relations
Oct 20, 2020
Raw model:
What i'm looking for is to have ability to select user who has roleA and roleB assigned at the same time:
GET /rest/user?filter={exp: 'role.name = $a and role.name=$b', params: {a: 'roleA', b:'roleB'}
- it will not work, so i'm looking for a way to define an alias for this magic, something like to (and yes, it could cause extra join):GET /rest/user?include={path:'role', alias: 'r1'}&include={path:'role', alias:'r2'}&filter={exp:'r1.name = $a and r2.name=$b', params: {a:'roleA', b:'roleB'}
Or by using new argument:
GET /rest/user?alias={path:'role', name:'r1'}&alias={path:'role', name:'r2'}&filter={exp:'r1.name = $a and r2.name=$b', params: {a:'roleA', b:'roleB'}
The text was updated successfully, but these errors were encountered: