This is the background code. There is no problem with the item value obtained, but the value in item.lists is still id. When traversing item.lists in jade, all the values obtained are null values, that is, in item.lists What is saved is still the objectId, not the data associated with populate.
Here are the schemas of mongoose.
There is no problem with foreign keys.
Excuse me, what is going on?
阿神2017-05-02 09:25:10
Category.findOne({_id:id})
.populate('lists')
populate should be the field name