Flavio
Flavio
CCConvex Community
Created by Flavio on 3/15/2024 in #support-community
Querying data
Hi, Based on the schema below, I am trying to query all the capex items for a given document and render it in a <div>. Can anyone help me out with this? export default defineSchema({ documents: defineTable({ title: v.string(), userId: v.string(), isArchived: v.boolean(), isPublished: v.boolean(), parentDocument: v.optional(v.id("documents")), client: v.optional(v.string()), country: v.optional(v.string()), technology: v.string(), description: v.optional(v.string()), }) .index("by_user", ["userId"]) .index("by_user_parent", ["userId", "parentDocument"]), // add a project table and make it a child of documents capex: defineTable({ capexName: v.string(), capexValue: v.float64(), endDate: v.float64(), startDate: v.float64(), capexDescription: v.optional(v.string()), userId: v.string(), parentDocument: v.id("documents"), }) .index("by_user", ["userId"]) .index("by_user_parent", ["userId", "parentDocument"]),
4 replies