使用模式填充猫鼬分页

问题描述

我有两个集合 users 和 user_details

用户收集样本数据

{
"_id" : ObjectId("60d2e60d7164d8d761fc5e63"),"username" : "test","email": "a@example.com"
}
user_details samples is 
{
"_id" : ObjectId("60cc3f83baa1941c85d8eee9"),"user_id": "60d2e60d7164d8d761fc5e63"
    "Address" : "Test add","city": "test city"
}

In mongoose schema of user details
new mongoose.Schema({
    user_id: {
        type: String,ref: 'User',},Address : String,City : String,{ collection: 'user_details' });

While fetching it inside populate I have added it 
 populate: [
                
                { path: 'User'}
            ],

用户详细信息未显示在结果中

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)