在mongoose中select几个字段作为数组

如果在我的模式架构数据集我有…

var visitSchema = new mongoose.Schema({ title : { type: String}, client : { type: String}, agenda : { type: String}, agm : { type: String }, anchor :{ type: String } )} 

所以在这里我想要一些其他的服务,将标题,客户端,议程分成一个数组和agm,锚定到其他数组来检索…
所以我试过这种方式

 function getExecsById(id){ var deferred = Q.defer(); console.log("im in getExecsById") var one = ('agm anchor'); //var two =('title client agend'); model .find({ _id: id }) .select(one) .exec(function (err, item) { item = item.map(function(doc) { return doc.one; }); if(err) { console.log(err); deferred.reject(err); } else deferred.resolve(item); }); return deferred.promise; } 

注意:不要改变架构…只有在服务分开的数据字段到两个数组并获取数据…..
提前谢谢

我假设Lodash可用。

 function getExecsById(id){ var partition = ['agm', 'anchor']; return model.findOne({ _id: id }) .then(function(item) { var p1 = [], p2 = []; return _.each(item, function(v, k) { if (partition.indexOf(k) !== -1) { p1.push(v); } else { p2.push(v); } }); }) .catch(function(error) { return error; }); }