node.js – NestJS mongoose schema with array of schema doesn’t populate virtual id

I have the following schema export type MapDocument = Map & Document @Schema({ timestamps: true, versionKey: false, id: true }) export class Map { constructor(partial?: Partial<Map>) { if (partial) Object.assign(this, partial) } @IsOptional() @IsUUID() @Prop({ type: Object, default: uuidv4, required: false}) @Exclude({ toPlainOnly: true }) _id?: Object @ApiPropertyOptional({ type: String, format: ‘uuid’ }) @IsOptional() @IsUUID() … Read more

node.js – “$pull” doesn’t delete the embedded documents of mongoose array

Backend – IndexJS const Koa = require(“Koa”); const client = require(“./dal/”); const bodyParser = require(“koa-bodyparser”); const cors = require(“@koa/cors”); const app = new Koa(); app.use(cors()); app.use(bodyParser()); const userRouter = require(“./routes/users.router”); app.use(userRouter.routes()).use(userRouter.allowedMethods()); const subjectsRouter = require(“./routes/subjects.router”); app.use(subjectsRouter.routes()).use(subjectsRouter.allowedMethods()); const courseRouter = require(“./routes/courses.router”); app.use(courseRouter.routes()).use(courseRouter.allowedMethods()); app.listen(3000); console.log(“server running on port 3000”); Backend – Dal – IndexJS const { MongoClient … Read more