0
我有這樣的瑪MongoDB中:如何在mongoDB中使用空數組?
"_id" : ObjectId("57a376dc317843700b7bd83f"),
"approved" : false,
"experience" : 0,
"placeOfWork" : "",
"education" : "",
"price" : 0,
"courses" : [],
"certificates" : [],
"createdAt" : ISODate("2016-08-04T17:09:48.773Z"),
"profileImg" : "images/profile.png",
"role" : "doctor",
"phone" : "",
"password" :'',
"email" : "[email protected]",
"foreName" : "",
"surname" : "",
"name" : "",
"__v" : 0
}
,我想存儲在字符串數組圖像證書[「形象」,「圖像」 ...]但我nee的特殊訂單,是更多鈔票像在JavaScript中由索引等
certificates{index] = 'something';
添加圖片到陣列和mongogoDb它存儲這樣的證書:[0: '東西',1: '某物' 中,x: '某物'] 0,1中,x感謝陣列證書的索引。