createMediaDocument
createMediaDocument<
TDataModel>(ctx,args):Promise<string>
Defined in: packages/file-storage-convex/src/adapter/methods.ts:23
Inserts a media document into the target collection table after a file upload completes.
Type Parameters
Section titled “Type Parameters”TDataModel
Section titled “TDataModel”TDataModel extends GenericDataModel = GenericDataModel
Parameters
Section titled “Parameters”GenericMutationCtx<TDataModel>
Convex mutation context.
Document fields: collectionSlug, storageId, filename, mimeType, size, optional alt and adapterFields.
adapterFields?
Section titled “adapterFields?”Record<string, unknown>
string
collectionSlug
Section titled “collectionSlug”string
filename
Section titled “filename”string
mimeType
Section titled “mimeType”string
number
storageId
Section titled “storageId”string
Returns
Section titled “Returns”Promise<string>
Promise resolving to the new media document ID as a string.