-
Is it possible to filter for the specific elements of a foreign reference? I'd like to do something like this // Project has projectMembers as a foreignref
// ProjectMember has roles as a foreignref
const projects = entityManager.projects.findAll({
filter: {
projectMembers: { containsElement: {
userId: { eq: "someUserId" },
roles: { containsElement: {
roleCode: { eq: "PROJECT_OWNER" }
}}
}
},
}
}); however, a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you want to filter Instead, if you want to filter the foreignRef or innerRef fields you can use |
Beta Was this translation helpful? Give feedback.
If you want to filter
Project
entities based on theprojectMembers
entity it is not yet possible, but it is in the roadmap (see issue #13). To work around this problem you can simply query theProjectMembers
entities and then search for theProject
that are related to the result of the previous query.Instead, if you want to filter the foreignRef or innerRef fields you can use
relations
field inside the find operations.