KvOriginal post
Web Developer
Posts and Comments are my two collections. In the Post collection, I created a two-way - one-to-many relationship so that I may retrieve all associated comments when I getDocument or listDocuments from the Posts collection. Consider the following scenario: A single post has 100 related comments. Is it possible to paginate relationships such that I only get the 3 most recent related comments when I get or list posts?
Summary
Pagination queries for relationships are not currently supported in Appwrite. However, you can achieve pagination by modifying your data structure. Instead of having a direct relationship between posts and comments, you can create a separate collection for comments and use a reference field to link each comment to a post. Then, you can use pagination queries on the comments collection to retrieve the desired number of recent comments for each post.