• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » MongoDB - component gives error on an OK query

#1 2012-05-18 14:02:39

geuder
Member
Company: Mojang
Registered: 2011-10-19
Posts: 92
Website

MongoDB - component gives error on an OK query

I'm trying to extend my job to update logged activities with a higher timestamp.
So I've extended my query in the tMongoDBInput-component, but it gives me errors.


From the database that holds:

{ "_id" : ObjectId("4fb19c90ae20889fb54f999d"), "ty" : "auth", "u" : "7224621ef1de421c8d3529cd85a89b4a", "ts" : "May 15, 2012 12:00:16 AM", "c" : "US", "ag" : "product x", "ip" : "23.20.8.225", "tsr" : { "floatApprox" : 1337040016204 } }

Am I trying to get all documents with an higher tsr than e.g. 1337040014785

When I run this query in console: db.logins.find({'tsr' : {$gt : 1337040014785}})
it works fine!



BUT When put {'tsr' : {$gt : 1337040014785}}  in the query-filed of the tMongoDBInput-component it gives me error:

Exception in component tMongoDBInput_1
com.mongodb.util.JSONParseException:
{'tsr' : {$gt : 1337040014785}}

            ^
Arrow pointing at dollar-sign.


AND If I simplify the query to only: "{'tsr' : 1337040014785}"
It gives me another error:

Exception in component tMongoDBInput_1
java.lang.NumberFormatException: For input string: "1337040014785"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:484)
    at java.lang.Integer.<init>(Integer.java:636)



What makes the error happen in Talend when it works fine from terminal?
(and how do I get this condition in the talend mongo component query field :-/


- - Edit - -

When I remove all conditions (no query), I also get an error:

Exception in component tMongoDBInput_1
java.lang.NullPointerException

Could this be related to the fact that the document has an embedded document and that I define the schema unsatisfactory?


- - - Edit2 - - -

https://github.com/adrien-mogenet/tMong … t/issues/2

Last edited by geuder (2012-05-18 14:11:33)

Offline

#2 2012-05-21 09:19:02

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: MongoDB - component gives error on an OK query

Hi

As tMongoDBInput is a custom component, we hope Adrien-mogenet can offer a solution.

Regards,
Pedro


Only Paranoid Survive.

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » MongoDB - component gives error on an OK query

Board footer

Powered by FluxBB