[#2587] - query error

Category:
Task
Priority:
Normal
Status:
New
Project: Severity:
Minor
Resolution:
Open
Component: Reproducibility:
N/A
Assigned to:

I've managed to create a connection to MongoDB.

In iReport, i'm asked to specify a query. Since my MongoDB collection is very basic, viz:
 
 "_id" : ObjectId("50a22c245941dfcbc391c9be"), "name" : "leeds", "county" : "n yorks" }
 "_id" : ObjectId("50a22dbd5941dfcbc391c9bf"), "name" : "tunbridge wells", "county" : "kent" }
 "_id" : ObjectId("50a22f3f5941dfcbc391c9c0"), "name" : "bangkok", "country" : "Thailand" }
 "_id" : ObjectId("50a22f665941dfcbc391c9c1"), "name" : "kuala lumpur", "country" : "Malaysia", "visited" : "Y" }
 
I just want to return all 4 rows into a really simple report.
 
So, my query is the equivalent of select * from table ie db.towns.find()
 
My assumption was this would return an array of data 4 rows deep and 4 columns across (name, county, country, visited). It runs in the Mongo shell (results above pasted out of there), but in iReport I  get 
QUERY ERROR
db.towns.find()
^
 
Query error
 
 
Message:
    com.mongodb.util.JSONParseException: 
db.towns.find()
^
Level:
    SEVERE
Stack Trace:
db.towns.find() ^
    com.mongodb.util.JSONParser.parse(JSON.java:381)
    com.mongodb.util.JSONParser.parse(JSON.java:328)
    com.mongodb.util.JSON.parse(JSON.java:287)
    com.mongodb.util.JSON.parse(JSON.java:272)
    com.jaspersoft.mongodb.query.MongoDbQueryWrapper.processQuery(MongoDbQueryWrapper.java:110)
    com.jaspersoft.mongodb.query.MongoDbQueryWrapper.(MongoDbQueryWrapper.java:99)
    com.jaspersoft.mongodb.MongoDbFieldsProvider.getFields(MongoDbFieldsProvider.java:94)
    com.jaspersoft.ireport.mongodb.designer.MongoDbFieldsProvider.getFields(MongoDbFieldsProvider.java:54)
    com.jaspersoft.ireport.mongodb.connection.MongoDbConnection.readFields(MongoDbConnection.java:187)
    com.jaspersoft.ireport.designer.wizards.ConnectionSelectionWizardPanel.validate(ConnectionSelectionWizardPanel.java:146)
    org.openide.WizardDescriptor$7.run(WizardDescriptor.java:1357)
    org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
    org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)

 

stuarthayes's picture
Joined: Nov 12 2012 - 12:50pm
Last seen: 10 years 2 months ago
Feedback