Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: MongoDB Input with limit, order by / sort

  1. #1
    Join Date
    Mar 2013
    Posts
    1

    Default MongoDB Input with limit, order by / sort

    Hi guys,

    I needed to generate some reports based on mongodb data but MongoDB Input step did't have the functionality I wanted so I did some enhancements and want to share it. I used pentaho-mongodb-plugin as a base that's why my extension is called pentaho-mongodb-plugin-ext, feel free to use it!

    New functions I added to the plugin:
    - order by / sort query
    - limit results
    - query parameters based on previous row

    First two are very simple, but query parameters need some explanation. You have to put "#" in mongo query and it will be replaced with first row of input stream. For example input stream (a=1,b=2,c=3,d=4) that will go to MongoDB Input step with query { "valA" : #, "valV" : #} will be replaced to { "valA" : 1, "valB" : 2} - similar to replacement in Table Input. Couldn't use variables in here cause Pentaho reports can only use Transformation and its impossible to set a variable inside one.

    It would be nice if at least order by and limit could be added in official version of this plugin. I can provide source code if you need.
    Attached Files Attached Files

  2. #2

    Default

    I found the solution, please see my post.


    http://stackoverflow.com/questions/2...nput-of-kettle

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.