Ok, I am using Algolia for handling search within my app. The following code adds whatever is in my database to my Algolia Index. However, whenever the data is imported, all of the values in a firebase node get placed under "text" in the Algolia Index.
How can make it to where it is stored as the key value pair found in Firebase.
i.e.
address: 1234 Main St.
VS. / (Instead of)
text:
address: 1234 Main St.
My Code:
exports.indexentry = functions.database
.ref('/blog-posts/{blogid}/text')
.onWrite(event => {
const index = client.initIndex(ALGOLIA_POSTS_INDEX_NAME);
const firebaseObject = {
text: event.data.val(),
objectID: event.params.blogid,
};
});