Model's `WhereInput` are not behaving as expected ...
# orm-help
i
Model's
WhereInput
are not behaving as expected in my GraphQL queries, anyone know how to get around it or is it a bug? I have a user with ID
5c2eb7d56344590009c22341
and when I query a user with
id
,
id_in
,
id_lt
,
id_gt
,
id_lte
,
id_gte
,
id_not
,
id_not_in
I get the expected results, but not with
id_contains
,
id_ends_with
,
id_starts_with
,
id_not_contains
,
id_not_ends_with
,
id_not_starts_with
. For instance, this returns an empty users array
Copy code
{
  users(where: {id_ends_with: "c22341" }) {
    id
  }
}
d
Hey, I’ll look into this in a bit, thanks for reporting this. I assume you are using the Mongo connector?
So the Prisma Mongo connector is using ObjectIDs as default data type for ids. It looks like MongoDB does not support partial matches against ObjectIds and does not intent to do so. https://jira.mongodb.org/browse/SERVER-1146 So it seems like the filters with id_contains etc.. that do partial matching are currently part of the API even though they can not work correctly. My solution would be to remove them from the API. Do you think you can work around not having them?