3
我有PhotoSchema
user
架構MongooseJS
與嵌入文檔photos
:限制內嵌文件大小
var UserSchema = new Schema({
email : { type : String, index : 'unique', set: toLower }
, login : { type : String, index : 'unique' }
, password : { type : String }
, salt : { type : String }
, photos : [ PhotoSchema ]
, name : { type : String }
});
當我retreive一個user
,我怎麼能限制的結果photos
數量設置?
或者我應該檢索用戶擁有的所有照片(即使有一百萬)?沒有照片的第一
1.Load用戶(S):