giovanni.chiozza_1 Posted June 15 Share Posted June 15 Hello ,I'm trying to understand how use MongoDb Query but syntax and concepts are not clear to me (I'm functional not developer).In this easy query I'm trying to show fields and also nested value into array fields . In this case containers.trackables.code{ 'collectionName' : 'TrackDocument' ,findFields : { 'docDate':1, 'docNumber':1, 'docStatus':1 , 'containers.trackables.code' : 1}, }I would like to see only the code and not all the mess of things into the container colum.How can achieve that ?For istance in first row I got two value 45500027 and 45500999 that would be the detail rows .I hope someone can help me because I'm very stuck.... Thanks Link to comment Share on other sites More sharing options...
Mehak Rajkumar Posted June 16 Share Posted June 16 Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times. Link to comment Share on other sites More sharing options...
jphadtar Posted June 16 Share Posted June 16 Hello,It looks like your requirement is more into SQl context how to write sql query to display specific portion of column than ireport design.You can use SQL string replace function to replace e.g. [{"trackables" : [{"code" : part of container column with space.You might need to use more such replace and concatinate SQL functions to write the query. Link to comment Share on other sites More sharing options...
giovanni.chiozza_1 Posted June 16 Author Share Posted June 16 Sorry but to query MongoDb from Ireport is not possible using SQL. The only way is to use MongoDbQuery within Ireport with its specific sintax.If it would be a sql DB the issue was not existing.Attached the json of that collection . If you are able to use SQL please let me no how.Thanks 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