This repository has been archived on 2026-05-01. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
PolyNotFound/app-backend/models/image.model.js
2021-11-12 15:00:49 +01:00

18 lines
377 B
JavaScript

module.exports = mongoose => {
let schema = mongoose.Schema({
base64: String,
fromUrl: String,
description: String,
type: Number
},
{ timestamps: true }
);
schema.method("toJSON", function() {
const { __v, _id, ...object } = this.toObject();
object.id = _id;
return object;
});
return mongoose.model("image", schema);
};