Daniel Diaz
Daniel Diaz
You either want to use a [discriminator](https://mongoosejs.com/docs/discriminators.html) or Define it as a [mixed type](https://mongoosejs.com/docs/schematypes.html#mixed)
First console log prints an id when it should print undefined
```typescript import * as mongoose from 'mongoose'; interface Hero { name: string, attribute: { attributes: { cou: { value: Number}, sgc: { value: Number} } } } interface Attribute {...
Could you please include the code for newItem?
Tested on 6.11.6, 7.4.0, and 8.5.2 and am unable to reproduce. ```javascript const mongoose = require('mongoose'); const channelSchema = new mongoose.Schema({ name: String }); const testSchema = new mongoose.Schema({ channels:...
```javascript var mongoose = require('mongoose'); function createCustomSchema() { return new mongoose.Schema( { prop1: { type: mongoose.Schema.Types.String, required() { console.log(this) return this.prop1 === undefined; }, validate: { validator(prop1) { if (this.prop2...