Query wp_postmeta into an array based on post_id

You can use get_post_meta( $post_id ) to retrieve all of the meta for a post. It will give you more than you need but you can filter it out after.

Here is the code reference – https://developer.wordpress.org/reference/functions/get_post_meta/

tech