Hello. This is my first post in this forum and i not familiarized with the forum rules. Sorry if something is wrong.

I can´t update mongodb document like i want.

this is the situation: I have a document in db that have to fields which are the key fields (like a compose key). In datastream i have this

Code:
key1, key2, New York, New york dataA1, New York dataA2
key1, key2, New York, New york dataB1, New York dataB2
key1, key2, Orlando, Orlando dataA1, Orlando dataA2
key1, key2, Orlando, Orlando dataB1, Orlando dataB2
....

And other similar.
Now I need to Insert/update to get this structure on mongodb:


Code:

{
   fieldkey1: key1,
   fieldkey2: Key2,
   cities : [
               {
                name : New York
                data: [
                             { 
                               data1 : New York dataA1,
                               data2 : New York dataA2
                              },
                              { 
                               data1 : New York dataB1,
                               data2 : New York dataB2
                              }
                        ]
                },
                {
                name : Orlando
                data: [
                             { 
                               data1 : Orlando dataA1,
                               data2 : Orlando dataA2
                              },
                              { 
                               data1 : Orlando dataB1,
                               data2 : Orlando dataB2
                              },
                              ....
                        ]
                }

            ]
}
I have test a lot of combinations with document/array structures and modifier policies but can´t do this.

In this place http://wiki.pentaho.com/display/EAI/MongoDb+output there is an example a lot of similar to my problem at point 2.4.1 (seem that the data stream structure is equals) but when i clone it, the step creates a new (root) document for each city, duplicating key fields. I had spend a lot of hours trying to solve this problem but no result until now.

Thanks.