Suppose I have an existing project on student records in which I have a collection named student.
const mongoose = require('mongoose');
const studentSchema = mongoose.Schema({
name,
email,
});
mongoose.model('student', studentSchema);
Now I am working on new on new project of teacher details in which I want all the details of students too. so for this what I want is that to use the same database url which I used in the student records project for the connection and use the existing schema of student by the same name without creating its copy. But I don't know how to do this. So, can you please help me. I will be very much thankful for you.
note:- both the project are located on different locations and will be host on different servers.