prisma.errors.FieldNotFoundError in a field that does exist in a table

382 Views Asked by At

Running this function with this character id

import asyncio
from prisma import Prisma, Json


async def main() -> None:
    db = Prisma()
    await db.connect()

    res = await db.character_ego.find_many(
        where={
            "metadata": Json({"character_id": "5ed33903-cbd8-4af6-ae74-97ea06a2d88e"})
        }
    )

    print(res)


asyncio.run(main())

However, I recieve this error continually: prisma.errors.FieldNotFoundError: Could not find field at findManycharacter_ego.where.metadata

But my schema does indeed contain metadata as a field

model character_ego {
  id        String                 @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
  content   String?
  metadata  Json?
  embedding Unsupported("vector")?
}

Followed the documentation here to a T https://prisma-client-py.readthedocs.io/en/stable/reference/operations/#json-fields

0

There are 0 best solutions below