I have an object as:
secondObject {
name: value,
userName: value,
userId; value,
}
And I have a pre-defined Model whose instance I am creating as
let modelObject: Model.
The Model is defined as follows
{
userName,
userId
}
Basically both models have some common fields and same data type since the first object I have described is just an extension of a join query on the Model and some other data, resulting into having an object that has all the fields of the Model plus some more.
What I want to do is:-
let thirdObj: Model;
obj = object
The 'object' above is one with the extra fields
and NOT get the obj as:
{
name: null,
userName: value,
userId; value,
}
But instead GET:
{
userName: value,
userId: value
}
Any ideas how I can achieve this?