Reputation:
i'm implementing interface and mongoose schemas in Typescript. The struggle with the follow issue:
The Schema should have contain these properties:
let MovementSchema = new Schema
({
movementName : {type: mongoose.Schema.Types.ObjectId, ref: 'MovementName'},
rounds: [{type: mongoose.Schema.Types.ObjectId, ref: 'Round'}]
});
the Interface look like this:
import { ObjectId } from "bson";
export interface IMovement {
movementType : ObjectId,
rounds : [ ObjectId ]
}
and the question is, the ObjectId
is the good type to create properties?
Upvotes: 0
Views: 3410