Skip to content

queryCollection.('collection_name').skip() and queryCollection.('collection_name').where(key, 'LIKE', value) or where(key, 'IN', array) not working for version 3.2.2 #3214

Closed
@fandy8255

Description

@fandy8255

Environment



Version

v3.2.2

Reproduction

https://stackblitz.com/edit/github-9ynqdouz?file=app%2Fpages%2F%5B...slug%5D.vue

Description

Ive not been able to use .skip() for my articles.md queries and aso not been able to filter articles by tag_names,

queryCollection('blog').skip(2).all() is not working
queryCollection('blog').where('tags', 'IN', 'tag_name').all() is not working

Here is a small fragment reproducing the issue, what could be the problem here? Thanks

{{ article.id }}
no articles found
<script setup> import { onMounted } from 'vue'; useHead({ link: { rel: 'stylesheet', href: 'https://unpkg.com/[email protected]/components/blogs/blog-3/assets/css/blog-3.css', }, }); const articles = useState('articles'); onMounted(async () => { /* const { data } = await useAsyncData('blog', () => queryCollection('blog').where('category', '=', 'Instagram').all() ); */ //WORKING //const { data } = await useAsyncData('blog', () => queryCollection('blog').limit(1).all()) //WORKING const { data } = await useAsyncData('blog', () => queryCollection('blog').skip(2).all() ); //NOT WORKING //console.log('data', data); /* const { data } = await useAsyncData('blog', () =>{ return queryCollection('blog').where('tags','IN','Vue').all() })*/ //NOT WORKING console.log('blog data', data); articles.value = data; window.scrollTo(0, 0); }); </script> <style> .hero-section { background: linear-gradient(to bottom right, #ff7eb9, #ff758c); color: white; /*height: 90vh;*/ width: 100%; background-image: url('/assets/images/hero-banner.jpg'); background-size: cover; background-position: center; /*padding: 100px 0;*/ } a { color: azure; } @media only screen and (max-width: 600px) { #main-container { padding: 1vw; } } </style>

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    v2Relevant for @nuxt/content v2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions