i have 2 models in mongoose , i want to assign values in the second model to the first one .
the geometry representation in first model 1st `
geometry: {
type: string;
coordinates?: [[number]];
};
`
the geometry representation in second model 2nd
geometry: {
type: string;
coordinates?: [type: [number]];
};
here is the representation of my assignement as u can see we have the first model representated in left side as a started line , the second model is which one i grab data and i'm using map méthod to loop inside it.
geometry: {
type: client.geometry.type,
coordinates: client.geometry.coordinates?.flatMap((coordinates) => coordinates)
}
the error i received is captured in a clear image here
how i can solve this problem?
-- keyword:
number[] [[number]]
i've tried to cast value . no effect same problem