Is it possible to use where
with the Content Query API (using Endpoints)?
#1420
-
I wanted to use the API routes with a If it's possible, I'd like a simple example like: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The docs don't specify how it should be done... After looking at the source code of the query module, I've figured out that you could send JSON parameters to the API 👇 const query = {
where: { _path: { $contains: "a" } }
};
const response = axios.get(`/api/_content/query?_params=${JSON.stringify(query)}`); This should return all articles containing 👉 https://content.nuxtjs.org/api/composables/query-content 🤠 |
Beta Was this translation helpful? Give feedback.
The docs don't specify how it should be done... After looking at the source code of the query module, I've figured out that you could send JSON parameters to the API 👇
This should return all articles containing
"a"
in their_path
.👉 https://content.nuxtjs.org/api/composables/query-content
🤠