payload
Version: 
Node, React, Headless CMS and Application Framework built on Next.js
18 lines (17 loc) • 428 B
JavaScript
const docWithFilenameExists = async ({ collectionSlug, filename, req })=>{
    const doc = await req.payload.db.findOne({
        collection: collectionSlug,
        req,
        where: {
            filename: {
                equals: filename
            }
        }
    });
    if (doc) {
        return true;
    }
    return false;
};
export default docWithFilenameExists;
//# sourceMappingURL=docWithFilenameExists.js.map