Issue:
We need to concatenate two fields 'firstname' and 'lastname' into one field using Jaspersoft MongoDB Query language.
How can this be achieved ?
Solution:
The following MongoDB Reference:
https://docs.mongodb.com/manual/reference/operator/aggregation/concat/index.html
has usages on how to perform a concatenation of string fields.
You can use the $concat operator within the aggregate operator.
Example for TIBCO JasperReports Server version 7.5:
{ collectionName : 'address', aggregate : [ { $project : { fullname : { $concat: [ "$firstname", " - ", "$lastname"] } } } ] }
Related Articles:
https://community.jaspersoft.com/wiki/jaspersoft-mongodb-query-language
Recommended Comments
There are no comments to display.
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