I'm trying to figure out how to 'extend' a schema (i.e. create a schema that inherits properties from a parent schema).
This is how I'm doing it:
const Vehicle = new Schema({
color: String
})
const Car = new Schema({
...Vehicle.props,
licensePlate: String
})
Is this the right way to do it?
I'm trying to figure out how to 'extend' a schema (i.e. create a schema that inherits properties from a parent schema).
This is how I'm doing it:
Is this the right way to do it?