arnaudsimon091 Posted May 15, 2020 Share Posted May 15, 2020 Hello everyone,I try to make a findQuery for mongoDB in jaspersoft studio but when I try to use a UUID in the process, I always have 0 results.Example query :{ 'collectionName' : 'Orders', 'findQuery' : { "_id" : UUID("4925b1a6-5cd6-6d19-9f2a-7a0083a7bb9a") }}Is there something wrong in my query in your opinion ?Thanks for your help Link to comment Share on other sites More sharing options...
Solution arnaudsimon091 Posted June 3, 2020 Author Solution Share Posted June 3, 2020 I finally found how to use a UUID in a mongo query.You should first convert your UUID in base64, to do so I used 2 online converters, the first one gave me the 12 first base64 caracters, the second one the 12 last (yes, this is strange).To give you a concrete example : Basic UUID : 41e73145-2489-54e1-d2fc-d400bea5e9b1Site 1 : QecxRSSJVOHS/AAA1AC+pQSite 2 : RTHnQYkk4VTS/NQAvqXpsQ==Final base64 result : QecxRSSJVOHS/NQAvqXpsQ==Then to use it in Jasper, you'll need this syntax : _id: new BinData(4,"QecxRSSJVOHS/NQAvqXpsQ==") 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