Updating product variant metafield

The metafield that i want to update is the stock of our shop so i can’t add it to the product level because i have the size and color as variant.

Is it possible to store an array as a variant’s metafield ?