mongoose multi-table query, no data found
// schema
var productSchema = new Schema({
id: Number,
specval:{type: Schema.Types.ObjectId,ref:"product_specval"}
},{collection:"product"})
var productSpecValSchema = new Schema({
_id: Schema.Types.ObjectId,
},{collection:"product_specval"})
//model
var productModel = mongoose.model("product",ProductSchema);
var productSpecValModel = mongoose.model("product_specval",productSpecValSchema);
productModel.findOne({"_id":id})
.populate("specval")
.exec(function(err,docs){
console.log(docs)
})
only the data in the product table is found, but the data of the associated product_specval is not found.
the data is imported by a few simple json, created by myself in a loop, and the value of ObjectId is also equal to