I am querying a mongodb using mongodb compass, and I cannot print the value in table form, it always prints {} 1 Fields..I want to print the value inside as a table. The same thing happens when i use mongoexport
You should use the aggregation pipeline, as I show you in the image below:
Another option is to use Robo3T (Ex Robomongo) with the following query:
db.getCollection('test').aggregate([ { '$addFields': {'birthdayValue': '$formAnswer.birthday.value'}}, {'$project': {'_id': 0, 'roleID': 1, 'birthdayValue': 1}}])