[Convex Ents] Problems with inverse field

Hi, I want to create another edge to my table to another table which keeps track of which user read a message so I first added the edge like that:

  users: defineEnt({})
    .field("clerkId", v.string(), { unique: true })
    .field("username", v.string(), { unique: true })
    .field("firstName", v.optional(v.string()))
    .field("lastName", v.optional(v.string()))
    .edges("privateChats")
    .edges("messages", { ref: true })
    .edges("readMessages", { to: "messages" }),

  messages: defineEnt({})
    .field("content", v.string())
    .field("deleted", v.boolean(), { default: false })
    .edge("privateChat")
    .edge("user")
    .edges("readBy", { to: "users" }),


With that I got this error:
Error: Hit an error while evaluating your schema:
Uncaught Error: Specify `table` if you're customizing the `field` or `inverseField` for a many:many edge. Config: `{"to":"messages","inverseField":"readBy"}` 


So I added the inverseFields:

  users: defineEnt({})
    .field("clerkId", v.string(), { unique: true })
    .field("username", v.string(), { unique: true })
    .field("firstName", v.optional(v.string()))
    .field("lastName", v.optional(v.string()))
    .edges("privateChats")
    .edges("messages", { ref: true })
    .edges("readMessages", { to: "messages", inverseField: "readBy" }),

  messages: defineEnt({})
    .field("content", v.string())
    .field("deleted", v.boolean(), { default: false })
    .edge("privateChat")
    .edge("user")
    .edges("readBy", { to: "users", inverseField: "readMessages" }),


So now I got this error:
Error: Hit an error while evaluating your schema:
Uncaught Error: Specify `table` if you're customizing the `field` or `inverseField` for a many:many edge. Config: `{"to":"messages","inverseField":"readBy"}`


I tried some other stuff too but I weren't able to get it working, this is one of my attempts.

Could someone tell me how I can build this thing?
Was this page helpful?