mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-29 17:55:24 +00:00
17 lines
387 B
TypeScript
17 lines
387 B
TypeScript
import { connectionMongo, type Model } from '../../mongo';
|
|
const { Schema, model, models } = connectionMongo;
|
|
|
|
const ImageSchema = new Schema({
|
|
userId: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: 'user',
|
|
required: true
|
|
},
|
|
binary: {
|
|
type: Buffer
|
|
}
|
|
});
|
|
|
|
export const MongoImage: Model<{ userId: string; binary: Buffer }> =
|
|
models['image'] || model('image', ImageSchema);
|