Is there anyone using <firestore-typesense-search>...
# community-help
e
Is there anyone using firestore-typesense-search extension?
@Jason Bosco
k
Yes, please set
"optional": true
to the field configuration.
e
When defining the schema?
k
Yes
e
Nice
Thanks!
k
Welcome!
e
I will post the answer and close the issue.
k
👍
e
Hey @Jason Bosco
If I delete a document using optional=true on all fields
Could this erase all variables for that document, even though de document didn't have this variables?
j
That should be possible...
e
I'm referring to having a schema with more variables than the collection per se and erasing that firestore document
j
Yup that should work
e
Nice
Thanks
j
Documents are deleted by ID, so when a document is deleted all fields in it are deleted fully
e
Nice
j
regardless of whether the fields are mentioned in the schema or not
e
Well
the fields are mentioned in the schema
the firestore document is the one that doesn't have them
j
As long as it just has an ID, which I believe all Firestore docs have
e
Sort of like having two sources of truth for one document
two*
Ok
The synchronization is the same
Another question
If I update that document on firestore, should the missing values on that document affect the whole record on typesense?
j
To make sure I understood you, you're asking if you delete a field from a Firestore document, will that field get deleted in the corresponding document in Typesense as well? - If so, yes
e
Meaning that if I send the firestore document minus 3,4,5, etc... fields (since the collection has less values than the schema definition), could the update/modify these missing values in case they were previously added?
For example, I define the schema with 5 fields (all of them optionals), my firestore collection with 3 fields.
I create a document and then after that creation, I update the other 2 fields.
Then I perform an update.
Would this update affect those 2 fields?
j
Yeah, with every update to the firestore document, the entire firestore document is synced over to Typesense and replaced fully with the contents of the document in Firestore