I think the input you expect is   {name: { key: value, key:value } }
I would like to see that in the doc for this method. It  is difficult to read the code if you do not have the structure in your mind.