From 5ecbae09d8caff0f7e68b35233eba73f0b6ff8c2 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 19 Dec 2022 18:01:06 +0100 Subject: [PATCH] docs: ssrKey notes --- docs/guide/ssr.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/guide/ssr.md b/docs/guide/ssr.md index 478d5cd2..868595e3 100644 --- a/docs/guide/ssr.md +++ b/docs/guide/ssr.md @@ -165,3 +165,24 @@ const { data: users } = useUserList() ``` --> + +## Manual SSR keys + +VueFire automatically infers an SSR key based on the path of the document or collection whenever possible. This means there are some scenarios where **you have to provide a manual `ssrKey`**: + +- When using Firestore Queries +- When binding the same document multiple times + +In these scenarios, provide the `ssrKey` as a second argument to `useDocument()`, `useCollection()`, etc: + + + +```ts +useDatabaseList(queryRef, { ssrKey: 'my-quiz' }) +``` + +```ts +useCollection(queryRef, { ssrKey: 'my-quiz' }) +``` + +