Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tDbMongoInput ParseError for Query

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 

Labels (2)
1 Solution

Accepted Solutions
vapukov
Master II
Master II


@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") + "\")\"}}"

View solution in original post

6 Replies
vapukov
Master II
Master II


@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") + "\")\"}}"
Anonymous
Not applicable
Author

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")
+ "\")\"}}");
Anonymous
Not applicable
Author

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")
+ "\")\"}}");


Screenshot from 2019-02-02 20-57-08.png
vapukov
Master II
Master II


@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

Anonymous
Not applicable
Author

Thanks For your Reply. It is working fine now . I m really sorry for typos mistake.

vapukov
Master II
Master II

it not a problem at all!

 

welcome to community!