#community-help

Using Typesense with Firebase Subcollections

TLDR Janick asked how to use Typesense with Firebase subcollections. Jason suggested flattening the collection and adding the sub-collection ID as an attribute. Alexander added info on permissions.

Powered by Struct AI
+11
7
17mo
Solved
Join the chat
Apr 06, 2022 (17 months ago)
Janick
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Janick
01:00 PM
Is there an example on how I can use Typesense with Firebase Subcollections?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
01:50 PM
The extension does not handle sub-collections. So you would have to add the sub-collection ID as an attribute inside each document in a flattened collection and sync that to Typesense
01:51
Jason
01:51 PM
So if you have something like users/<user_id>/profile you would convert that to user_profiles and have user_id as an attribute inside each document
Janick
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Janick
02:53 PM
Ok, will do it that way. Thank you 👌
+11
Alexander
Photo of md5-8ac455f6d302407f03def4c775778b28
Alexander
05:00 PM
Janick You can do permissions like that too. viewable_by_group=test,admin,user
Janick
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Janick
05:01 PM
Yes I think so, I did the following:
05:02
Janick
05:02 PM
So you can achieve this with
category:= [Running Shoes, Men, Sneaker]