Tag: mongoose restify mongoose

无法使用mongoosejs进行填充

为什么我不能得到结果,而试图填充我的计划(我使用mongoosejs)。 在我的情况下,我的类别,子类别,sububcategoryscheme不使用_id。 我使用自定义ID。 这是我的产品scheme: ….. categoryId: { type: String, ref: 'Catgory', required: true }, subcategoryId: { type: String, ref: 'Subcategory', required: true }, subsubcategoryId: { type: String, ref: 'Subsubcategory', required: true }); const Product = mongoose.model('Product', product); module.exports = Product; 这是我的产品控制器: 'getOne': function(req, res, next) { if (typeof req.params.id !== 'string') return res.send({ 'error-code': 3 […]