Hmza
CCConvex Community
•Created by Hmza on 9/12/2024 in #support-community
convex x hono
i'm not able to make the hono
.notfound
endpoint work.
i get errors if i just visit a wrong path rather it showing a message of not found or something.
22 replies
CCConvex Community
•Created by Hmza on 9/10/2024 in #support-community
can't do 2 crons in file ?
I can't do two same crons in one crons.ts ?
params are different but i want to run two crons with different params.
3 replies
CCConvex Community
•Created by Hmza on 9/9/2024 in #support-community
i had to calculate data from db. and i ended up using pagination with mutation. fallbacks ?
convex
export const getAllDataWithDetails = mutation({
args: { paginationOpts: paginationOptsValidator, filterType: v.string() },
handler: async (ctx, args) => {
const { filterType, paginationOpts } = args;
const data = await ctx.db
.query("data")
.filter(q => q.eq(q.field("type"), filterType))
.order("desc")
.paginate(paginationOpts);
return data;
},
});
react
const getAllDataWithDetails = useMutation(api.data.export.getAllDataWithDetails);
let allData = [];
let hasMore = true;
let cursor = null;
while (hasMore) {
const result = await getAllDataWithDetails({
filterType: selectedFilter,
paginationOpts: { cursor, numItems: 5000 },
});
allData = [...allData, ...result.page];
hasMore = !result.isDone;
cursor = result.continueCursor;
}
is this all right todo? any fallbacks or suggestions ?3 replies
CCConvex Community
•Created by Hmza on 8/10/2024 in #support-community
Is it possible to add 'Functions breakdown By Time' aswell
Currently the dashboard shows Functions breakdown by dates only. Is it possible to add by time too so the tests can be done on what is consuming what? would be great to have that.
5 replies
CCConvex Community
•Created by Hmza on 8/8/2024 in #support-community
one function costed 17GB reads in one day
40 replies
CCConvex Community
•Created by Hmza on 4/2/2024 in #support-community
lucia auth with user roles
just starting out with convex and while still learning about schemas and mutations with convex here.
how can i add another field in the numbers tables from the example on github, field would be simply
users_id
to attach user to numbers (which they created)
end goal: to create new table with user roles.
ref: https://stack.convex.dev/convex-with-lucia
import { defineSchema, defineTable } from "convex/server";
import { authTables } from "@convex-dev/convex-lucia-auth";
import { v } from "convex/values";
export default defineSchema(
{
...authTables({
user: {
email: v.string(),
},
session: {},
}),
numbers: defineTable({
user: v.id(authTables.users._id)
value: v.number(),
}),
},
{ schemaValidation: true },
);2 replies