An Interest In:
Web News this Week
- April 27, 2024
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
April 9, 2022 12:46 am GMT
Original Link: https://dev.to/dingzhanjun/custom-query-with-strapi-v3-dem
Custom Query with Strapi V3
Below code can be used in controller:
const knex = strapi.connections.default;
const result = await knex('articles_tags__tags_articles as atta')
.where('tag_id', 2)
.join('articles', 'atta.article_id', 'articles.id')
.select('articles.*')
https://docs-v3.strapi.io/developer-docs/latest/development/backend-customization.html#queries
Original Link: https://dev.to/dingzhanjun/custom-query-with-strapi-v3-dem
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To