0
我收集的MongoDB這樣的:角fullstack:調用API沒有_id,像findByField
var CategorySchema = new mongoose.Schema({
Name: String,
Description: String,
Picture: {
type: String,
default: 'http://placehold.it/64x64'},
Level: {
type: Number,
default: 1},
Owner:{
type: Schema.ObjectId,
ref: 'Category'}
});
怎樣才能得到業主使用,因爲這個API只是可以得到由_id導致。
謝謝你,我會嘗試。但什麼是'category_model' –
這是一個貓鼬模型,請參閱http://mongoosejs.com/docs/2.7.x/docs/model-definition.html – alexey