[Vuejs]-Using $contains in a Nuxt Content API query

0👍

I considered deleting this question as the answer was in fact very simple, but I’ve decided I’ll answer it instead in case anyone else has the same issue. You can just pass the url parameter retrieved from the front-end script to the back-end script and it will stil work. This question seems to have arisen more from my fundamental misunderstanding of Nuxt/Vue

const getPostsByTag = async (tag) => {
  return queryContent().where({ 'tags': { $contains: tag } }).find()
}

Leave a comment