我有嵌入式文档的user
架构:MongooseJS
photos
PhotoSchema
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 }
});
当我检索一个user
时,如何限制photos
结果集中的数量?
或者我应该检索用户拥有的所有照片(即使有一百万张)?