MissingSchemaError: Schema hasn’t been registered for model "UserAddress"

I am Trying to Populate data from User Address resources to User Resources
1)Both Resource Database connection Done in App Module Then user schema register in User Module and User Address Schema register in User Address Module
also I register schema in Model but last 4 day continually throw same error when I populate user with user address from another connection error:MissingSchemaError: Schema hasn’t been registered for model “UserAddress”

path: Nestjs\new-api\src\location\schema\location.schema.ts


import * as mongoose from 'mongoose'
import { Schema } from 'mongoose';


export const UserAddressSchema = new Schema({
  name: { type: String, required: true },
  city: { type: String, required: true },
});

module.exports = mongoose.model('Useraddress',UserAddressSchema);

path : Nestjs\new-api\src\auth\schema\auth.schema.ts

import * as mongoose from 'mongoose';
import { Schema } from 'mongoose';

export const UserSchema = new Schema({
  username: { type: String, required: true },
  password: { type: String, required: true },
  email: { type: String, required: true },
  useraddress: [{ type: Schema.Types.ObjectId ,ref:'UserAddress'}],
});
module.exports=mongoose.model("User", UserSchema,'Userdb')

path : Nestjs\new-api\src\app.module.ts

import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { UserModule } from './auth/user.module';
import { LocationModule } from './location/location.module';
@Module({
  imports: [
    MongooseModule.forRoot('mongodb://127.0.0.1:27017/User', {
      connectionName: 'Userdb',
    }),
    MongooseModule.forRoot('mongodb://127.0.0.1:27017/Location', {
      connectionName: 'Locationdb',
    }),
    UserModule,
    LocationModule,
  ],
  controllers: [],
  providers: [],
  // exports:[MongooseModule]
})
export class AppModule {}

path : Nestjs\new-api\src\auth\user.module.ts

import { UserService } from './user.service';
import { UserController } from './user.controller';
import { MongooseModule } from '@nestjs/mongoose';
import { UserSchema } from './schema/auth.schema';
import {LocationModule} from '../location/location.module'
@Module({
  imports: [
    MongooseModule.forFeature(
      [{ name: 'User', schema: UserSchema, collection: 'User' }],
      'Userdb',
    ),
    LocationModule
    ],
  controllers: [UserController],
  providers: [UserService],
  exports: [UserService],
})
export class UserModule {}

path : Nestjs\new-api\src\location\location.module.ts

import { Module ,Global} from '@nestjs/common';
import { LocationService } from './location.service';
import { LocationController } from './location.controller';
import { MongooseModule } from '@nestjs/mongoose';
import { UserAddressSchema } from 'src/location/schema/location.schema';
import { UserSchema } from 'src/auth/schema/auth.schema';
import * as mongoose from 'mongoose';
@Module({
    imports:[
        MongooseModule.forFeature([{name:"UserAddress",schema:UserAddressSchema}],"Locationdb")
    ],
    controllers: [LocationController],
    providers: [LocationService],
    exports:[MongooseModule,LocationService]
})
export class LocationModule {}

Hi, I have the same issue.
you solved it?.

Nothing to do anything only one think you can do if have 2 diffrent connection with seprate schema like user and book and if you trying to get user with book detail please pass ref of book in user schema and book schema register in both module in book and User also my english in not good if you not understand tell me i am also reply in simple way

yes ,

import { Module } from ‘@nestjs/common’;

import { UserService } from ‘./user.service’;

import { UserController } from ‘./user.controller’;

import { MongooseModule } from ‘@nestjs/mongoose’;

import { UserSchema } from ‘./schema/user.schema’;

import { BookSchema } from ‘src/book/schema/book.schema’;

@Module({

imports: [MongooseModule.forFeature([{name:“User”,schema:UserSchema}],‘Userdb’),MongooseModule.forFeature([{name:“Book”,schema:BookSchema}],“Bookdb”)],

controllers: [UserController],

providers: [UserService]

})

export class UserModule {}