Como adicionar outro ID do esquema no MongoDB
//first Schema
const user = new Schema({
username:[type:String, unique:true]
})
//second Schema
const notes = new Schema({
id : [{ type: Schema.Types.ObjectId, ref: 'user' }] // gets _id of first Schema(user)
notes:[type:String, trim:true]
})
Rohit Yadav