0
Как я могу найти коллекцию ассоциации и получить все результаты с этим запросом? Пример:Паруса/Ватерлиния: Найти по ассоциациям
ПОСТЫ МОДЕЛЬ
module.exports = {
attributes: {
title: 'string',
content: 'string',
coverImage: 'string',
owner: {
model: 'user'
},
tags: {
collection: 'ContentTag',
via: 'posts',
dominant: true
}
}
};
TAGS МОДЕЛЬ
module.exports = {
attributes: {
name: 'string',
posts: {
collection: 'post',
via: 'tags'
}
}
};
мне нужно:
*POSTS.find({
where: {
tags: 1
}
}).populateAll() // All Post with ID tag 1*
Без использования: TAGS.find ({id: 1})