How do i run internalMutations in nodejs?
import { internalMutation } from "../_generated/server";
import { participantEntry } from "../schema";
export const upsertParticipant = internalMutation({
args: participantEntry,
handler: async (ctx, args) => {
const exists = await ctx.db
.query("entries")
.withIndex("byGroupId", (q) => q.eq("groupId", args.groupId))
.unique();
if (exists) return true;
await ctx.db.insert("participantEntry", args);
return true;
},
});import { internalMutation } from "../_generated/server";
import { participantEntry } from "../schema";
export const upsertParticipant = internalMutation({
args: participantEntry,
handler: async (ctx, args) => {
const exists = await ctx.db
.query("entries")
.withIndex("byGroupId", (q) => q.eq("groupId", args.groupId))
.unique();
if (exists) return true;
await ctx.db.insert("participantEntry", args);
return true;
},
});btw, I am in persistent nodejs environment.
