add upsert function to metadata

I added an upsert function the to metadata module.