Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: MongoDb filtering data

  1. #1
    Join Date
    Apr 2014
    Posts
    18

    Default MongoDb filtering data

    I need help filtering data coming out of MongoDb step.
    Scenario: I am trying to pull data from MongoDb and load it into MySql database.

    I am having issues with one field where the condition is - for a User(_id) field there can be many companies and I want filter the data in a way that we can 'ONLY' display the companies associated with each user and not the "role" and "addedByHakoon" fields in the output. Please see below for sample data.

    Sample data:
    User(_id)
    Companies
    55082dafe44765445b1ec80b { "5507560f2382f09ef01a6c8f" : { "role" : "ADMINISTRATOR" , "addedByHaakon" : true} , "55082daee44765445b1ec80a" : { "role" : "ADMINISTRATOR" , "addedByHaakon" : true}}
    55082dc32eff4b2cae103dc5 { "55082dc32eff4b2cae103dc4" : { "role" : "ADMINISTRATOR" , "addedByHaakon" : true}}
    5508bc5f596af07f5d89890a { "5508bc5f596af07f5d898909" : { "role" : "ADMINISTRATOR" , "addedByHaakon" : true} , "536cdfe2462e8c04f4000023" : { "role" : "ADMINISTRATOR" , "addedByHaakon" : true} , "551acd590d5fcba515334d24" : { "role" : "ADMINISTRATOR" , "addedByHaakon" : false}

    Expected Output:
    User(_id) Companies
    55082dafe44765445b1ec80b 5507560f2382f09ef01a6c8f
    55082dafe44765445b1ec80b 55082daee44765445b1ec80a
    55082dc32eff4b2cae103dc5 55082dc32eff4b2cae103dc4
    5508bc5f596af07f5d89890a 5508bc5f596af07f5d898909
    5508bc5f596af07f5d89890a 536cdfe2462e8c04f4000023
    5508bc5f596af07f5d89890a 551acd590d5fcba515334d24

    Any help is appreciated.

  2. #2
    Join Date
    Apr 2014
    Posts
    18

    Default

    Anyone has any idea about how to do this?

  3. #3
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    AFAIK there's no way JSON-Input will return keys from a JavaScript Object.
    Attached Files Attached Files
    So long, and thanks for all the fish.

Tags for this Thread

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.