Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: MongoDb Input Query expression not working with ObjectId data type

  1. #1

    Default MongoDb Input Query expression not working with ObjectId data type

    An example

    Query expression: {'_id': ObjectId('46646545kgksgkg54545t5')}
    Fields expression: {}

    Works fine in command line.

  2. #2

    Default

    Try something like:


    { "_id" : { "$oid" : "52C9F2000000000000000000"}}


    For comparisons, something like:


    { "_id" : { $gt : {$oid:"52C9F2000000000000000000"} } }


    should work. (You probably already know this, but you can use the MongoId to pull data by insertion date using the Mongo _id because the first part of the ObjectId is actually the time and date of the record insertion.)


    If you open up the MongoDB input step and do a preview with the query expression set to {}, you can take a look at the format that the data is coming back with. Try to match this format for your query.


    Good luck,


    Mark

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.