updating tags array to nested documents