KrleDanoK
Convex Community3y ago
11 replies
KrleDano

How to create unique field in Convex

How do I restrict the name to be unique meaning, two document can't have same name?
export default defineSchema({
  transactionCategory: defineTable({
    name: v.string(), // has to be unique
    icon: v.optional(v.string()),
  }),
});
Was this page helpful?