Spaces:
Runtime error
Runtime error
Download src/models/base.js from yeshwanth-kr/dss-server: direct link, hf CLI and curl.
- Browser
- Download file 414 Bytes
-
https://huggingface.co/spaces/yeshwanth-kr/dss-server/resolve/main/src/models/base.js
- Command line
-
hf download hf://spaces/yeshwanth-kr/dss-server/src/models/base.js
-
curl -L -o base.js https://huggingface.co/spaces/yeshwanth-kr/dss-server/resolve/main/src/models/base.js
414 Bytes
| const mongoose = require('mongoose'); | |
| function baseSchemaOptions() { | |
| return { | |
| timestamps: { | |
| createdAt: 'created_at', | |
| updatedAt: 'updated_at' | |
| }, | |
| toJSON: { | |
| virtuals: true, | |
| transform: (_doc, ret) => { | |
| ret.id = ret._id.toString(); | |
| delete ret._id; | |
| delete ret.__v; | |
| return ret; | |
| } | |
| } | |
| }; | |
| } | |
| module.exports = { mongoose, baseSchemaOptions }; | |