Closed bwgjoseph closed 3 years ago
@bwgjoseph what I have been told is that data will always be returned even if its an empty array
Yup, that's correct.
The issue here is that the interface is declared that the data might not be returned (optional as it was declared with ?)
As mentioned in the first post, the correct interface declaration should be
export interface ManyResponse {
// notice that there is no ? (question mark) after data
data: T[];
match_number: number;
success: number;
errors: StatusExecution[];
}
Below is the current declaration (with ? after data)
Ah ok, let me open a ticket to address this and see what is the response
I mean the interface
Since that, all multi-methods will always return
data
, it doesn't make sense to make it optional unless there is case wheredata
is not being returnedOriginally posted by @bwgjoseph in https://github.com/bwgjoseph/mongoose-vs-ottoman/issues/82#issuecomment-856892249