0

My actually collection looks like this

    ID: ...,
   param1: value1
   param2: value2

But i want to add a user id to this object so that this will be look like this

userid:{
ID: ...,
param1: value1,
param2: value2
}

Is there any way to do this?

Thanks

1 Answers1

0

make a new schema name user_detail now u have 2 schema one is user and other is user_detail user schema will be like schema:{ userid:{ type:Object, ref:user_detail } }

user_detail schema:{ ID: ..., param1: value1, param2: value2 } By doing this your end result will be like this

_Id:'', userid:{ _Id:'', param1: value1, param2: value2 }