Home > database >  Kettle mongo time type in how to use?
Kettle mongo time type in how to use?

Time:09-27

Problem description:
{" $query ": {" timestamp" : {" $gt ": the new Date (' 2010/02/04 10:00:10 ')}}}
Such a query in the mongo can query, but is cannot be queried in the kettle,

The error information is as follows:
2014/09/23 11:26:26 - Version checker - OK
2014/09/23 11:26:30 - E: \ kettle_ktr \ KETTLE_MONGODB \ test KTR: test - to transform to remove patch began [E: \ kettle_ktr \ KETTLE_MONGODB \ test KTR: test]
2014/09/23 11:26:31 - directing Input. 0 - you connection with read preference: primary
2014/09/23 11:26:31 - directing Input. 0 - No read preference tag sets defined
2014/09/23 11:26:31 - directing Input. 0 - you connection with default write concern - w=1, wTimeout: 0, journaled=false
2014/09/23 11:26:31 - directing Input. 0 - ERROR (version 5.0.1 - stable, _16 build 1 from 2013-11-15-08-58 by buildguy) : Unexpected ERROR
2014/09/23 11:26:31 - directing Input. 0 - ERROR (version 5.0.1 - stable, _16 build 1 from 2013-11-15-08-58 by buildguy) : org. Pentaho. Di. Core. Exception. KettleException:
2014/09/23 11:26:31 - directing Input. 0 and Unexpected error
2014/09/23 11:26:31 - directing Input. 0
{" $query ": {" timestamp" : {" $gt ": the new Date (' 2010/02/04 10:00:10 ')}}}
^
2014/09/23 11:26:31 - directing Input. 0
2014/09/23 11:26:31 - directing Input. 0 - at org. Pentaho. Di. Trans. Steps. Mongodbinput. Mongodbinput. The processRow (mongodbinput. Java: 156)
2014/09/23 11:26:31 - directing Input. 0 - at org. Pentaho. Di. Trans. Step. RunThread. Run (60) RunThread. Java:
2014/09/23 11:26:31 - directing Input. 0 - at Java. Lang. Thread. The run (722) Thread. Java:
2014/09/23 11:26:31 - directing Input. 0 - under Caused by: the mongo. Util. JSONParseException:
{" $query ": {" timestamp" : {" $gt ": the new Date (' 2010/02/04 10:00:10 ')}}}
^
2014/09/23 11:26:31 - directing Input. 0 - at the mongo. Util. JSONParser. Read (272) JSON. Java:
2014/09/23 11:26:31 - directing Input. 0 - at the mongo. Util. JSONParser. Parse (JSON. Java: 161)
2014/09/23 11:26:31 - directing Input. 0 - at the mongo. Util. JSONParser. ParseObject (JSON. Java: 231)
2014/09/23 11:26:31 - directing Input. 0 - at the mongo. Util. JSONParser. Parse (JSON. Java: 195)
2014/09/23 11:26:31 - directing Input. 0 - at the mongo. Util. JSONParser. ParseObject (JSON. Java: 231)
2014/09/23 11:26:31 - directing Input. 0 - at the mongo. Util. JSONParser. Parse (JSON. Java: 195)
2014/09/23 11:26:31 - directing Input. 0 - at the mongo. Util. JSONParser. ParseObject (JSON. Java: 231)
2014/09/23 11:26:31 - directing Input. 0 - at the mongo. Util. JSONParser. Parse (JSON. Java: 195)
2014/09/23 11:26:31 - directing Input. 0 - at the mongo. Util. JSONParser. Parse (JSON. Java: 145)
2014/09/23 11:26:31 - directing Input. 0 - at the mongo. Util. JSON. Parse (JSON. Java: 81)
2014/09/23 11:26:31 - directing Input. 0 - at the mongo. Util. JSON. Parse (JSON. Java: 66)
2014/09/23 11:26:31 - directing Input. 0 - at org. Pentaho. Di. Trans. Steps. Mongodbinput. MongoDbInputData. JsonPipelineToDBObjectList (MongoDbInputData. Java: 1339)
2014/09/23 11:26:31 - directing Input. 0 - at org. Pentaho. Di. Trans. Steps. Mongodbinput. Mongodbinput. InitQuery (mongodbinput. Java: 202)
2014/09/23 11:26:31 - directing Input. 0 - at org. Pentaho. Di. Trans. Steps. Mongodbinput. Mongodbinput $1. The run (95) mongodbinput. Java:
2014/09/23 11:26:31 - directing Input. 0 - at org. Pentaho. Di. Trans. Steps. Mongodbinput. Mongodbinput $1. The run (72) mongodbinput. Java:
2014/09/23 11:26:31 - directing Input. 0 - at org. Pentaho. The mongo. AuthContext. DoAs (AuthContext. Java: 68)
2014/09/23 11:26:31 - directing Input. 0 - at org. Pentaho. Di. Trans. Steps. Mongodbinput. Mongodbinput. The processRow (mongodbinput. Java: 72)
2014/09/23 11:26:31 - directing Input. 0 -... 2 more
2014/09/23 11:26:31 - directing Input. 0 to finish processing (I=0, O=0, R=0, W=0, U=0, E=1
2014/09/23 11:26:31 - E: \ kettle_ktr \ KETTLE_MONGODB \ test KTR: test - E: \ kettle_ktr \ KETTLE_MONGODB \ test KTR: test
2014/09/23 11:26:31 - E: \ kettle_ktr \ KETTLE_MONGODB \ test KTR: test - E: \ kettle_ktr \ KETTLE_MONGODB \ test KTR: test

CodePudding user response:

Want to ask: why can't I use isodate types in kettle???????????????

CodePudding user response:

The original poster hello,
Because I did not use a kettle, so just can provide from you to find problems in the errorlog,
Provide errorlog through you, I have found this JIRA
https://jira.mongodb.org/browse/JAVA-565

Try to seconds and millisecond completion to try it
The parser accepts these two date formats: seconds - & gt; "MM - dd yyyy - the 'T' HH: MM: ss 'Z'" or
Seconds. Milleseconds - & gt; "MM - dd yyyy - the 'T' HH: MM: ss. The SSS 'Z'"

CodePudding user response:

Thank moderator answered

CodePudding user response:

reference zhaowensheng123 reply: 3/f
thank moderator answered

Welcome to provoke ~
Want to help,

CodePudding user response:

{created_at: {$gte: {$date: "the 2014-12-31 T00:00:00. 000 z"}}}

Finds all created_at documents that are greater than or equal to the specified UTC date

CodePudding user response:

nullnullnullnull
  • Related