users.nickname); // list: ["hello","nniiii"]"> users.nickname); // list: ["hello","nniiii"]"> users.nickname); // list: ["hello","nniiii"]">

[javascript] 객체 배열에서 속성 값을 배열로 추출 - 리뷰나라

const users: Users[] = await this.usersRepository.find({
  select: ['nickname'],
});
/*
users: [
	{
		"nickname" : "hello"
	},
	{
		"nickname" : "nniiii"
	}
]
*/

const list = users.map((users) => users.nickname);
// list: ["hello","nniiii"]