Quantcast
Channel: Mongoose model seperations - Stack Overflow
Browsing index pages (2 articles)

Mongoose model seperations

Im new to node and mongodb. I have the following mongoose model. import { model, Schema } from 'mongoose'; import Joi from '@hapi/joi'; const profileSchema = new Schema({ user: { type:...

View Article


Answer by twcardenas for Mongoose model seperations

Yes, you should seperate them. To link them you would just put the profile schema Id as a field on the other models. const profileSchema = new Schema({ userId: Schema.Types.ObjectId }) const...

View Article

Browsing index pages (2 articles)


Latest Images