I have a small app where I need to query my firestore data. The query is a variable of a search string. It is working fine if the user enters in an exact match query. However, I need the user to be able to search a term LIKE what is in the data. Not just exact match.
Example Query: searchInput = "Exact Match Term"; querySnapshot = await firebase.firestore().collection('markers').where('title', '==', searchInput).get();
That will work only if the user enters in the title exactly as it shows in the data. I need it to pull anything like the search term. I have tried this and it does not pull any documents: searchInput = "PartialTerm"; querySnapshot = await firebase.firestore().collection('markers').where('title', 'array-contains', searchInput).get();
I changed '==' to 'array-contains' to avoid the exact match but now no records come in at all.
So, my question is how do I do a search query to the data where it will return all documents within my "markers" collection where the title is LIKE the searchInput from the user.
Thank you for helping me.