Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Getting Array elements from MongoDB

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2011
    Posts
    20

    Arrow Getting Array elements from MongoDB

    Hi All,

    I want to migrate data from mongodb to a relational database.

    In mongo, we have a json with keys, arrays, sub documents and arrays in subdocument.

    We are trying to flatten the structure to a csv format for each array, each subdocument etc., My immediate requirement is to convert each array object
    to a separate record.

    {
    department : _id
    depart_name : string
    employee : array
    employee_id : number
    employee_name: string
    phonenumber : string
    }


    I would like to create two files one containing the following fields

    department_id,
    depart_name

    and another with the following structure

    department_id
    employee_array_id
    employee_id
    employee_name
    phonenumber

    The first file is pretty straightforward. Can you suggest the best way to extract all the element objects of an array into a separate flat record?
    We can assume the json structure is fixed and is uniform across all documents.

    Sample json format attached.


    PDI 4.4 in linux version,

    MongoDB 2.5.4,

    Vertica 6.x.
    Attached Files Attached Files
    siva.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.