Jump to content
Changes to the Jaspersoft community edition download ×

Ireport e MongoDb Query (array)

Recommended Posts

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

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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


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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...