0

I have a table with about 2m records with following structure:

{
    "fields": "values",
    "transactions": [
         {
              'from': '...',
              'value': '...'
         }
    ]
}

Now I want to separate the data in transaction field to be separate records in another table. Is there some native way to do it in rethinkdb?

Visgean Skeloru
  • 2,237
  • 1
  • 24
  • 33

1 Answers1

1

I was able to do it using concatMap:

r.table('transactions').insert(
   r.table('records').concatMap(function (doc){return doc('transactions')})
)
Visgean Skeloru
  • 2,237
  • 1
  • 24
  • 33