I'm attempting to perform a complex query with firestore v9. My intention is to get some docs (skip and limit) from a my data structure. What I mean is, I need to get for example 5 docs from a doc -> collections -> doc. and this docs need to be order by there date.
So for example, lets say in my array I contain 2 docs id ['e4z3HNyUCQbiYQRzfVO4RyebMCP2', 'WZImI6tl0IUFKbICEZzcciaUxKG2']
, from this 2 docs, I would need to get their userPosts ordered by the creation date, but I would need to pass a skip and limit too. So from this 2 docs, I would limit 3 docs to get, but these 3 docs will be from the 2 posts ids I passed.
const queryBuild = await query(
collection(db, 'posts'),
where('userPosts', 'in', [`post.id`...]),
collection(db, 'userPosts'),
...
);
const querySnapshot = await getDocs(queryBuild);