I am working with the Firebase Realtime Database, and my "description" subkey is indexed (the below structure has it mentioned).
{
"check123": {
"description": "Linked In Page",
"tags": [
"one"
],
"url": "https://linkedin.com"
},
"fb": {
"description": "My Facebook page",
"tags": [
"one",
"two"
],
"url": "https://facebook.com"
},
"twitter": {
"description": "My Twitter page",
"url": "https://twitter.com"
}
}
I wanted to search for "Facebook" in "description" key so that it returns the "fb" key's object. I am able to get it using search term "My Facebook" with below code:
get(
query(
ref(db, "/dbSubPathToMentionedObject"),
orderByChild("description"),
startAt(searchTerm),
endAt(searchTerm+"\uf8ff")
)
)
where searchTerm is the variable for the current search term. But I want to search for substring from the middle. Is it possible? If so how?