v4.5.2 (#439)
This commit is contained in:
16
packages/service/common/file/image/schema.ts
Normal file
16
packages/service/common/file/image/schema.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user