0
您能否幫助我。 我搜索了互聯網,找不到任何解決方案。 如何爲小孩創建查詢以使用父項的參數?爲孩子創建查詢以使用父母的參數
var Photos = new Schema({
photo_id: {type: String, required: true},
photo_path_low: { type: String, required: true }
});
var Users = new Schema({
user_id: { type: String, required: true },
count_coins: { type: Number, default: 20 },
photos_relation: [Photos]
});
...
... some code
...
PhotoModel.findOne().where('parent.count_coins').gt(1)..... // parent for Example
您的照片方案沒有提及用戶。 – Paul
如何添加對用戶的引用?舉個例子,如果不是困難的話。 – user3424119
閱讀文檔它包含您需要的所有內容 –