Skip to content

Filter for entity with array that contains element? #271

Answered by edobrb
Atlinx asked this question in Q&A
Discussion options

You must be logged in to vote

At the moment it's not supported. We'll work on it ASAP.

A possible workaround could be to transform your model as follow:

type Config @entity @mongodb {
    id: ID! @id(from: "db") @alias(value: "_id")
    
    textChannelIds: [ConfigTextChannel!] @foreignRef
    voiceChannelIds: [ConfigVoiceChannel!] @foreignRef
    categoryId: String
}

type ConfigTextChannel @entity @mongodb {
    id: ID! @id(from: "db") @alias(value: "_id")
    configId: ID!
    value: String!
}

type ConfigVoiceChannel @entity @mongodb {
    id: ID! @id(from: "db") @alias(value: "_id")
    configId: ID!
    value: String!
}

And executing the find on the ConfigTextChannel or the ConfigVoiceChannel and then find the C…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Atlinx
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants