Creating new documents from existing Array items of a doument

Check this post. Answer is at the end. Delete few items from nested document based on a condition