Replies: 2 comments
-
Thanks for submitting. This is something we are very interested in supporting, as we have seen the limits that come with attempting to solve every use-case with specific APIs. The exact shape is unknown, but this is something we are likely working on as we approach 3.0. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Related: #689 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Body
Summary
Currently the Astro content support is based on getCollection() and getEntryBySlug()
This is good enough for most use cases, however it lacks rich query API.
Some similar frameworks such as NuxtJS Content module provides rich set of API for querying content.
Background & Motivation
Lack of rich set of querying API forces developers to implement it their self.
Other similar frameworks are available which provides excellent querying capabilities for markdown content.
It will help developers implement complex, nested content organisation, and flexibility to query and display
based on different criteria effectively and without code duplication.
Goals
max
,limit
,offset
for queries returning list of content entriesExample
queryContent('articles').where({ title: 'Home' }).findOne()
const articles = await queryContent('articles').where({ name: { $in: ['odin', 'thor'] } }).find()
queryContent('articles').skip(5).limit(5).find()
Beta Was this translation helpful? Give feedback.
All reactions