Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: MongoDB input query by ObjectId

  1. #1
    Join Date
    Sep 2012
    Posts
    3

    Default MongoDB input query by ObjectId

    Hi,

    I ran into a problem while running the following mongodb input step:

    so here I want to do date range selection - everything from Dec 1, 2012. This query works without problems in mongo shell by kettle does not accept it.

    Name:  mongodb_input.jpg
Views: 583
Size:  25.4 KB

    Here is the trace:

    2013/02/18 18:39:24 - MongoDb Input.0 - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : Unexpected error
    2013/02/18 18:39:24 - MongoDb Input.0 - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : com.mongodb.util.JSONParseException:
    {'_id' : {'$gte' : ObjectId("50b98ed00000000000000000")}}

    ^

    I see the JSON parser does not accept functions in query.

    Is there a special way of writing it, so that it gets passed to mongodb server for execution?

  2. #2
    Join Date
    Jul 2011
    Posts
    1

    Default

    I have the same issue, Did you ever find a solution?

    Thanks
    Eric Smith

  3. #3
    Join Date
    Oct 2013
    Posts
    3

    Default

    Hi,
    change your query as below
    {'_id' : {'$gte' : {'$oid': "50b98ed00000000000000000"}}}

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.