1

I have a UUID field called id in my MongoDB. When I retrieve it as a part of the aggregation query in mongo shell ( version: 4.0.8), it responds in Binary format! e.g :

db.collection.aggregate([{"$project" : {"id" : 1, "name" : 1 ...}}])

I get response as:

{ "id" : BinData(3, "JliB6gIMRuSphAD2KmhzgQ=="), "name" : "XYZ.." ...}

Can I get this ID in original UUID format that is "-" seperated and then convert it to string inside the mongoshell somehow?

sap
  • 234
  • 5
  • 16

0 Answers0