next/lib/server/storyHelpers/getBucket.ts
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ c8bdcc0ec3
refactor(server/utils): create reusable utilities for various story-related functions
`bodyHandler` takes a request body and returns the chapter content as a string
`formChapterTransform` serializes a chapter-like object supplied in a request body to an actual
	proper chapter object
`getBucket` retrieves the story content gridfs bucket
`replaceGridFS` either creates or updates (deletes + reuploads) a gridfs file
2023-10-03 00:42:24 -04:00

10 lines
216 B
TypeScript

import { GridFSBucket } from "mongodb";
import mongoose from "mongoose";
export default function () {
// @ts-ignore SHUT UP MEG
return new GridFSBucket(mongoose.connection.db, {
bucketName: "story_text",
});
}