Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: JSONPath and PDI's MongoDB Input step

  1. #1
    Join Date
    Oct 2013
    Posts
    28

    Default JSONPath and PDI's MongoDB Input step

    I wonder if someone could clarify the relationship between PDI's MongoDB Input Step and JSONPath. There are a couple forum posts that refer to this reference but I'm not sure why simple looking queries aren't working.

    For example, I need to transform some user documents stored in a mongo collection, using a document structure like:

    Code:
    {
      "_id" : ObjectId("5d7a5034041ba5fe61010003"),
      "classID" : "14",
      "userID": "10",
      "otherField": "other data..."
    }
    If I query for a specific user id, I have no trouble:

    Code:
    { "$query" : { "userID" : "10" } }
    However if I try to use a wildcard, I get no rows. I would expect the following JSONPath queries to return a row (containing one string field) for each user document in the collection but instead they fail:

    Code:
    { "$query" : "$..*" }
    Code:
    { "$query" : { "userID" : "*" } }
    The wiki has some information on basic operations but precious little on the query syntax. Any suggestions, pointers or clarifications would be greatly appreciated.
    Last edited by psema4; 11-08-2013 at 02:34 PM. Reason: missing comma in sample document structure; clarify expected results

  2. #2
    Join Date
    Oct 2013
    Posts
    28

    Default

    Found some additional query samples which are enough for my immediate needs. If there's a tutorial or article on Mongo + PDI somewhere, I'd be interested in hearing about it.

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.