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):