嘿我有一個問題,從我的數據庫中刪除嵌套數組,我想使用findOneAndUpdate和$pull。我的意思是從reply陣列中刪除項目。我嘗試通過_id找到評論項目並刪除此回覆項目,但這不起作用。請看下面我的代碼。 我的架構 var productSchema = new Schema({
description: [{
type: String,
require: tru
我的架構 let citySchema = new mongoose.Schema({
...
});
let countrySchema = new mongoose.Schema({
regions : [{
cities : [ref: 'City']
}]
});
問題 - 如何插入現有城市到選擇的(通過_id)區。一個區域的_id是由貓