Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to find record from mongo by date , So i write one query
"{\"date\":{\"$gte\":\"ISODate(\"" + globalMap.get("max_QueryUpdatedAt") + "\")\"}}"
it giving the parseError
@maheep6776 wrote:
I want to find record from mongo by date , So i write one query
"{\"date\":{\"$gte\":\"ISODate(\"" + globalMap.get("max_QueryUpdatedAt") + "\")\"}}"
it giving the parseError
Hi,
what the full error text?
btw, try this:
"{\"date\":{\"$gte\":\"ISODate(\"" + (String)globalMap.get("max_QueryUpdatedAt") + "\")\"}}"
@maheep6776 wrote:
I want to find record from mongo by date , So i write one query
"{\"date\":{\"$gte\":\"ISODate(\"" + globalMap.get("max_QueryUpdatedAt") + "\")\"}}"
it giving the parseError
Hi,
what the full error text?
btw, try this:
"{\"date\":{\"$gte\":\"ISODate(\"" + (String)globalMap.get("max_QueryUpdatedAt") + "\")\"}}"
I want this mongo query in TalendEtl tmongoDbInput,
{"date" : {$gte:ISODate("2019-01-03T09:56:11.244Z")}})
I used globalMap.get("max_QueryUpdatedAt") for storing date
and i m getting following error , I have tried your Query
"{\"date\":{\"$gte\":\"ISODate(\"" +
(String)globalMap.get("max_QueryUpdatedAt") + "\")\"}}"
I am attaching error Screen Shot
Code generated by Talend
com.mongodb.DBObject myQuery = (com.mongodb.DBObject) com.mongodb.util.JSON
.parse("{\"date\":{\"$gte\":\"ISODate(\""
+ (String) globalMap.get("max_QueryUpdatedAt")
+ "\")\"}}");
@maheep6776 wrote:
I want this mongo query in TalendEtl tmongoDbInput,
{"date" : {$gte:ISODate("2019-01-03T09:56:11.244Z")}})
and i m getting following error , I have tried your Query
"{\"date\":{\"$gte\":\"ISODate(\""+(String)globalMap.get("max_QueryUpdatedAt") + "\")\"}}"
as you could see you have a difference in query code, what you want and what you send
try this
"{\"date\":{$gte:ISODate(\""+(String)globalMap.get("max_QueryUpdatedAt") + "\")}}"
P.S. keep in mind - here not a mongodb forum, and I not a MongoDB queries expert 🙂
so, I could only suggest proper check Java syntax
Thanks For your Reply. It is working fine now . I m really sorry for typos mistake.
it not a problem at all!
welcome to community!