Currently working with nestjs and trying to retrieve data from a collection based on the 'name' value. However, the output I am getting looks like this:
https://i.stack.imgur.com/q5Vow.png
Here is the service code:
async findByName(name):Promise<Usersinterface>{
const data = this.usersModel.find(name).exec();
return data;
}
And here is the controller code:
@Get('getitem')
async getItem(@Body() name): Promise<any>{
return this.usersService.find_one(name);
}