mongodb collection m에 저장된 데이터
tag : {
가: {
like : 0,
dislike: 0,
},
나: {
like: 0,
dislike: 0,
},
}
서버에서 '가' 를 변수에 넣고, 가에 들어있는 모든 속성(like, dislike)을 불러오려고 하는데
const name = "가";
db.collection('m').find( { "tag" : name } ).toArray(function(err, result) {
console.log(result);
})
이렇게 짰는데 빈 배열이 출력되네요 머가 문제일까요?