prisma1
prisma1 copied to clipboard
$WHERE OR / NOT available in mongodb?
I can't seem to use WHERE OR , WHERE NOT in MongoDB

Am I doing something wrong?
No, these were disabled in the Mongo connector in order to enable filters on relations. We might bring them back in the future, but for now we valued a quicker implementation of relational filters higher than OR, NOT.
I hope you can work around the lack of these for now?
Thanks for the answer @do4gr
Hi @do4gr in practice how should be filtering ? Or should we wait until more work has been done?
Curious how you accomplish this now with something like this before using Postgres?
query SEARCH_SNAKES_QUERY($searchTerm: String!) {
snakes(
where: {
OR: [
{ name_contains: $searchTerm }
{ description_contains: $searchTerm }
]
}
) {
id
image
name
}
}
Is there some other way we are supposed to do this now in the Mongo connector world?
The only option I could think of for the moment is to create two separate subscriptions for this.
No, these were disabled in the Mongo connector in order to enable filters on relations. We might bring them back in the future, but for now we valued a quicker implementation of relational filters higher than
OR,NOT.I hope you can work around the lack of these for now?
Hi @do4gr , any update about this topic?
No, sorry we are currently focusing on the upcoming Prisma 2 release.
No, sorry we are currently focusing on the upcoming Prisma 2 release.
Thanks for your answer!
Please provide any work around for OR in MongoDB, its one of the major query parts. Otherwise we have 4 products in prisma and have to move to mongod connector.
It's a shame this is not mentioned in the docs: https://v1.prisma.io/docs/1.34/prisma-client/basic-data-access/reading-data-JAVASCRIPT-rsc2/#basic-filters-for-lists Just lost half a day debugging this :(