Prisma1: $WHERE OR / NOT available in mongodb?

Created on 21 Jan 2019  路  10Comments  路  Source: prisma/prisma1

I can't seem to use WHERE OR , WHERE NOT in MongoDB

image
image

Am I doing something wrong?

kinfeature areconnectomongo

Most helpful comment

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?

All 10 comments

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 :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thomaswright picture thomaswright  路  3Comments

sorenbs picture sorenbs  路  3Comments

Fi1osof picture Fi1osof  路  3Comments

marktani picture marktani  路  3Comments

AlessandroAnnini picture AlessandroAnnini  路  3Comments