Possible to fetch user details from another field

Let me tell u the complete scenario:
We have old user data in Realm db and have migrated that db to Realm mongodb.
When the old user tries to login it will fail since that user is not present in Auth of Realm.
Forecefully register that user in Auth, use the above query to fetch the user details based on the primarykey of user table and login
Follow up to the following question: