ano_nym_ous Posted February 12, 2018 Share Posted February 12, 2018 Hello,I have a Mongo Query which is extracting the subducument from a collection and projects its fields.The query is working fine, but I am not able to put it into the Jaspersoft MongoDB Query which is necessary for getting the dataset!I looked through https://community.jaspersoft.com/wiki/jaspersoft-mongodb-query-languagebut without success.Is anybody able to convert this statement into a working query for a jasper report? db.getCollection('a').aggregate({ $unwind: "$b"}, { $project: { attribute: "$b.attribute" }}) Any help would be highly appreciated! Link to comment Share on other sites More sharing options...
ano_nym_ous Posted February 13, 2018 Author Share Posted February 13, 2018 Ok.. so at the moment I think my query is correct.. but the problem seems to be the "JRException: The 'cursor' option is required, except for aggregate with the explain argument"Has anyone experience with this problem? Link to comment Share on other sites More sharing options...
ano_nym_ous Posted February 13, 2018 Author Share Posted February 13, 2018 . Link to comment Share on other sites More sharing options...
ben.strydom Posted March 5, 2018 Share Posted March 5, 2018 I also getting this error since upgrading to MongoDB 3.6.3. It only occurs when doing an aggregation query.2018-03-05 10:15:32,130 ERROR GenericExceptionMapper,http-nio-8080-exec-3:50 - Unexpected error occursnet.sf.jasperreports.engine.JRException: The 'cursor' option is required, except for aggregate with the explain argument at com.jaspersoft.mongodb.query.MongoDbQueryWrapper.runCommand(MongoDbQueryWrapper.java:207) at com.jaspersoft.mongodb.query.MongoDbQueryWrapper.processQuery(MongoDbQueryWrapper.java:115) at com.jaspersoft.mongodb.query.MongoDbQueryWrapper.<init>(MongoDbQueryWrapper.java:93) at com.jaspersoft.mongodb.query.MongoDbQueryExecuter.createDatasource(MongoDbQueryExecuter.java:104)When specifying the options field using the jaspersoft-mongodb-query-language, i get the following error in the log:2018-03-05 10:14:12,893 ERROR JRQueryExecuterAdapter,http-nio-8080-exec-7:155 - Error while executing querynet.sf.jasperreports.engine.JRException: unrecognized field 'options'I've replaced the java driver in the server lib dir but the error persists. Link to comment Share on other sites More sharing options...
tizatt Posted May 16, 2018 Share Posted May 16, 2018 I have gotten the exact same error after upgrading to MongoDB 3.6. Haven't found a solution either Link to comment Share on other sites More sharing options...
pjacekm Posted May 23, 2018 Share Posted May 23, 2018 There was a change in MongoDB version 3.6. Per MongoDB docs (https://docs.mongodb.com/manual/reference/command/aggregate/#dbcmd.aggregate):Changed in version 3.6: MongoDB 3.6 removes the use of aggregate command without the cursor option unless the command includes the explain option. Unless you include the explain option, you must specify the cursor option.So, you just need to add an empty "cursor" document.Also, pipeline needs to be an array.So, your query in JR needs to be similar to the following example:{ "runCommand": { "aggregate" : "{collection name}", "pipeline" : [ { "$match": { ... } }, { ... } ], "cursor": {} }}[/code] Link to comment Share on other sites More sharing options...
cto_2 Posted July 14, 2018 Share Posted July 14, 2018 It doesn't work even if the empty cursor block is given.The issue is that the Jaspersoft mongodb Connector (js-mongodb-datasource-2.0.9.jar) - the code is expecting the result data as inline results ('results' field). But MongoDB 3.6 results a cursor.So it gives a 'No results exception' . This requires code change in the js-mongodb-datasource-2.0.9.jar and needs to be rebuilt. I could n't find the source of this component any where.Due to this issue, Jasper report is almost unusable in all typical reports with MongoDB 3.6 and 4.0Please help to resolve this issue Link to comment Share on other sites More sharing options...
pratik.g Posted July 14, 2018 Share Posted July 14, 2018 There is an updated js-mongodb-datasource-2.0.10.jar available at http://jaspersoft.artifactoryonline.com/jaspersoft/jaspersoft-repo/com/jaspersoft/connectors/mongodb/js-mongodb-datasource/2.0.10/.Does it contains this fix?How to apply this patch? Link to comment Share on other sites More sharing options...
deepakgup Posted July 18, 2018 Share Posted July 18, 2018 Hi All - We are hitting the same issue in our deployment. Upgraded MongoDB to latest build and started getting this issue. Anyone found any hacks or fixed "jar". Link to comment Share on other sites More sharing options...
cto_2 Posted July 20, 2018 Share Posted July 20, 2018 No. The latest js-mongodb-datasource-2.0.10.jar also doesn't solve this issue.We need either need the fix or the source code for this jar file so that we ccan fix it. Link to comment Share on other sites More sharing options...
kkumlien Posted August 10, 2018 Share Posted August 10, 2018 Only MongoDB versions 3.0-3.4.1 are certified: https://community.jaspersoft.com/documentation/v710/tibco-jasperreports-server-supported-platform-datasheet Link to comment Share on other sites More sharing options...
mohamed.aghoulas Posted July 11, 2019 Share Posted July 11, 2019 any new updates on this issue ? Link to comment Share on other sites More sharing options...
mohamed.aghoulas Posted July 12, 2019 Share Posted July 12, 2019 any new updates on this issue ? Link to comment Share on other sites More sharing options...
kkumlien Posted July 15, 2019 Share Posted July 15, 2019 See latest comment on the bug report here: https://community.jaspersoft.com/mongodb-connector/issues/10886#comment-858831 Link to comment Share on other sites More sharing options...
kkumlien Posted July 15, 2019 Share Posted July 15, 2019 See latest comment on the bug report here: https://community.jaspersoft.com/mongodb-connector/issues/10886#comment-858831 Link to comment Share on other sites More sharing options...
gsoultan Posted August 7, 2019 Share Posted August 7, 2019 any new updates on this issue ? How is everybody handling this ? Link to comment Share on other sites More sharing options...
rjurado Posted September 3, 2019 Share Posted September 3, 2019 Same error, any updates? Link to comment Share on other sites More sharing options...
Solution kkumlien Posted September 3, 2019 Solution Share Posted September 3, 2019 See latest comment on the bug report here: https://community.jaspersoft.com/jasperreports-server/issues/10886#comment-859521It might not help for Studio but it might for JasperReports Server. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now