imagesMetadata.ts•490 B
import { v } from "convex/values";
import { query } from "./_generated/server";
// @snippet start getMetadata
export const getMetadata = query({
args: {
storageId: v.id("_storage"),
},
handler: async (ctx, args) => {
return await ctx.db.system.get(args.storageId);
},
});
export const listAllFiles = query({
handler: async (ctx) => {
// You can use .paginate() as well
return await ctx.db.system.query("_storage").collect();
},
});
// @snippet end getMetadata