Get username when using an external database

I connected a MongoDb database, hoping it would be easier to interact with it and populate it with data the user would be able to add (address, postal code, phone, etc).
The connection works just fine, but even though my username-password-authentication requires username, once I use my MongoDb, that username is not there in the profile (it was there using the rules below before going to Mongo for db).

I added a few rules to the Auth pipeline, such as Add Username to AppMetadata and add country to user profile, and also this one to get the username in the token:

function (user, context, callback) {
  context.idToken['http://my-space/username'] = user.username; 
  return callback(null, user, context);
}

But from the connection to mongo the username ones don’t work and my profile is very lean and bare.

I’m aware my question may sound very basic, and I would appreciate a lot some guidance.

The ultimate goal is to be able to attach more data to the profile (address, payment method, etc).

I’d like to know if going Mongo is the way to do this or if I’m missing some basic steps in the process.

Thank you in advance,

Guillermo