Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 9, 2022 12:46 am GMT

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:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To