#community-help

Setting Typesense Schema to Return Boolean in Firestore

TLDR Rude needed help to make his firestore's typesense schema return boolean 'profileFinished' as true. Jason provided the correct instructions and resolved the issue.

Powered by Struct AI
4
18mo
Solved
Join the chat
Jul 12, 2022 (18 months ago)
Rude
Photo of md5-4a36c3bc25964c64330a5747ba443346
Rude
05:13 PM
In my firestore users collection i have a boolean profileFinished, how can i set my typesense schema to return only when that boolean is true?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:14 PM
You want to set that field as type: boolean in the schema. And then when doing a search, you want to set filter_by: profileFinished:true
05:14
Jason
05:14 PM
If you don't want users to change this, you can also embed this search parameter in a scoped API key and use that api key to make the search request
Rude
Photo of md5-4a36c3bc25964c64330a5747ba443346
Rude
06:22 PM
Awesome, that worked. Thank you!