Need help to merge the documents after filtering

I was able to remove “title” and “description” fields from the document using “objectToArray” and “$map” to filter.
I needed help merging the document now and filtering the empty sub-document.

{
    "_id" : "63dadc6753bfc516421c5958",
    "properties" : [
        {
            "k" : "abc:id",
            "v" : [
                {

                },
                {
                    "k" : "type",
                    "v" : "string"
                },
                {

                }
            ]
        },
        {
            "k" : "abc:authenticatedState",
            "v" : [
                {

                },
                {
                    "k" : "type",
                    "v" : "string"
                },
                {
                    "k" : "default",
                    "v" : "ambiguous"
                },
                {
                    "k" : "enum",
                    "v" : [
                        "ambiguous",
                        "authenticated",
                        "loggedOut"
                    ]
                }
            ]
        },
        {
            "k" : "abc:primary",
            "v" : [
                {

                },
                {
                    "k" : "type",
                    "v" : "boolean"
                },
                {
                    "k" : "default",
                    "v" : false
                },
                {

                }
            ]
        }
    ]
}

To get rid of the empty documents from an array you would use $filter with

cond : { "$ne" : [ "$$this" , { } }

The reverse operation of $objectToArray to merge back the k: and v: is $arrayToObject.