Algolia just saving objectID and not the actual data

Hi there, I am using a firebase cloud function to store my posts to algolia but somehow it’s not storing the post content and just the document id of the post as objectID.
Here is the cloud function:

exports.createPost = functions.firestore
    .onCreate( async (snap, context) => {
    const newValue =;
    newValue.objectID =;

    var client = algoliasearch(ALGOLIA_APP_ID, ALGOLIA_ADMIN_KEY);

    var index = client.initIndex(ALGOLIA_INDEX_NAME);
    console.log("Creation Finished");

This is my firebase snapshot:

And this is what I get from Algolia:

Also, if I add a document with some fields, it doesn’t even appear in Algolia(That’s why the doc “helloworld” has no fields)
Please help.