I'm querying a database in Javascript where I get back a Map object. The problem is that the key of some entry in the map is an object, an EnumValue to be precise.
I can't seem to find a way to directly retrieve this kind of entries. The only that comes to my mind is to iterate on every single key of the map and check if it's an object.
So, if I console.log the output I get from the query, it looks like this:
Map {
EnumValue { typeName: 'T', elementName: 'label' } => 'user',
'gender' => [ 'f' ],
'identityid' => [ '2349fd9f' ],
'name' => [ 'Erika' ],
'email' => [ '[email protected]' ],
EnumValue { typeName: 'T', elementName: 'id' } => 4136,
'lastname' => [ 'Delgato' ]
}
I've naively already tried to get the entry using something like this:
const enumId = { typeName: 'T', elementName: 'label' };
map.get(enumId)
But of course it returns undefined.
Any ideas?