Reflection in motoko has been an often requested feature. There are apparently issues with implementing it:
If you absolutely must have it, you may have some success with GitHub - edjCase/motoko_candid. You need to to_candid your object into a candid format and then parse through the resultant object.
This would be useful if you were trying to read the memory store of a canister that just dumped state to a blob array and that contained unknown types and you were trying to marshal them to known types.