Hi Team,
When I am running following query on mongo shell, it gives me expected result
db.<my collection>.find({"calendar_date" : new Date("2015-01-01T08:00:00.00Z")})
but if I use the same in MongoDB Input step, it does not work and gives me following error. Can anyone help here?
{ "$query" : { "calendar_date" : new Date("2015-01-01T08:00:00.00Z") } }
2016/08/03 16:19:53 - MongoDb Input 2.0 - Configuring connection with read preference: primary
2016/08/03 16:19:53 - MongoDb Input 2.0 - No read preference tag sets defined
2016/08/03 16:19:53 - MongoDb Input 2.0 - Configuring connection with write concern - w = 1, wTimeout = 0, journaled = false
2016/08/03 16:19:53 - MongoDb Input 2.0 - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : Unexpected error
2016/08/03 16:19:53 - MongoDb Input 2.0 - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : org.pentaho.di.core.exception.KettleException:
2016/08/03 16:19:53 - MongoDb Input 2.0 - com.mongodb.util.JSONParseException:
{ "$query" : { "calendar_date" : new Date("2015-01-01T08:00:00.00Z") } }
^
2016/08/03 16:19:53 - MongoDb Input 2.0 -
{ "$query" : { "calendar_date" : new Date("2015-01-01T08:00:00.00Z") } }
^
2016/08/03 16:19:53 - MongoDb Input 2.0 -
2016/08/03 16:19:53 - MongoDb Input 2.0 - at org.pentaho.di.trans.steps.mongodbinput.MongoDbInput.processRow(MongoDbInput.java:141)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at java.lang.Thread.run(Thread.java:745)
2016/08/03 16:19:53 - MongoDb Input 2.0 - Caused by: com.mongodb.util.JSONParseException:
{ "$query" : { "calendar_date" : new Date("2015-01-01T08:00:00.00Z") } }
^
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSONParser.read(JSON.java:280)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSONParser.parse(JSON.java:171)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSONParser.parseObject(JSON.java:241)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSONParser.parse(JSON.java:205)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSONParser.parseObject(JSON.java:241)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSONParser.parse(JSON.java:205)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSONParser.parse(JSON.java:155)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSON.parse(JSON.java:93)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSON.parse(JSON.java:74)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at org.pentaho.di.trans.steps.mongodbinput.MongoDbInput.initQuery(MongoDbInput.java:227)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at org.pentaho.di.trans.steps.mongodbinput.MongoDbInput.processRow(MongoDbInput.java:83)
2016/08/03 16:19:53 - MongoDb Input 2.0 - ... 2 more
2016/08/03 16:19:53 - MongoDb Input 2.0 - Finished processing (I=0, O=0, R=0, W=0, U=0, E=1)
Thanks.. Jawed
When I am running following query on mongo shell, it gives me expected result
db.<my collection>.find({"calendar_date" : new Date("2015-01-01T08:00:00.00Z")})
but if I use the same in MongoDB Input step, it does not work and gives me following error. Can anyone help here?
{ "$query" : { "calendar_date" : new Date("2015-01-01T08:00:00.00Z") } }
2016/08/03 16:19:53 - MongoDb Input 2.0 - Configuring connection with read preference: primary
2016/08/03 16:19:53 - MongoDb Input 2.0 - No read preference tag sets defined
2016/08/03 16:19:53 - MongoDb Input 2.0 - Configuring connection with write concern - w = 1, wTimeout = 0, journaled = false
2016/08/03 16:19:53 - MongoDb Input 2.0 - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : Unexpected error
2016/08/03 16:19:53 - MongoDb Input 2.0 - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : org.pentaho.di.core.exception.KettleException:
2016/08/03 16:19:53 - MongoDb Input 2.0 - com.mongodb.util.JSONParseException:
{ "$query" : { "calendar_date" : new Date("2015-01-01T08:00:00.00Z") } }
^
2016/08/03 16:19:53 - MongoDb Input 2.0 -
{ "$query" : { "calendar_date" : new Date("2015-01-01T08:00:00.00Z") } }
^
2016/08/03 16:19:53 - MongoDb Input 2.0 -
2016/08/03 16:19:53 - MongoDb Input 2.0 - at org.pentaho.di.trans.steps.mongodbinput.MongoDbInput.processRow(MongoDbInput.java:141)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at java.lang.Thread.run(Thread.java:745)
2016/08/03 16:19:53 - MongoDb Input 2.0 - Caused by: com.mongodb.util.JSONParseException:
{ "$query" : { "calendar_date" : new Date("2015-01-01T08:00:00.00Z") } }
^
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSONParser.read(JSON.java:280)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSONParser.parse(JSON.java:171)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSONParser.parseObject(JSON.java:241)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSONParser.parse(JSON.java:205)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSONParser.parseObject(JSON.java:241)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSONParser.parse(JSON.java:205)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSONParser.parse(JSON.java:155)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSON.parse(JSON.java:93)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at com.mongodb.util.JSON.parse(JSON.java:74)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at org.pentaho.di.trans.steps.mongodbinput.MongoDbInput.initQuery(MongoDbInput.java:227)
2016/08/03 16:19:53 - MongoDb Input 2.0 - at org.pentaho.di.trans.steps.mongodbinput.MongoDbInput.processRow(MongoDbInput.java:83)
2016/08/03 16:19:53 - MongoDb Input 2.0 - ... 2 more
2016/08/03 16:19:53 - MongoDb Input 2.0 - Finished processing (I=0, O=0, R=0, W=0, U=0, E=1)
Thanks.. Jawed