为什么Mongoose不允许我访问JSON属性?

在我的路线文件中,我有

router.get('/users/:user', function(req, res) { mongoose.model('users').find({name: req.params.user}, function(err, user) { res.send(user.name || 'User.name is not defined' ); }); }); 

我的模式被定义为

 var userDataSchema = new Schema({ name: String }, {collection: 'users'}); mongoose.model('users', userDataSchema); 

在我的路线文件中,如果我只是做res.send(user) ,那么它给了我适当的JSON与所有的用户与他们的名字。 我的问题是,我无法从JSON访问特定的名称。

我已经尝试做JSON.stringify(user) ,然后JSON.parse()该variables,但user.name仍然无法访问。 我现在也尝试过user.toJSON() ,但是这会导致错误,甚至不响应'User.name is not defined'

编辑:这是JSON:

 [ { _id: "57feb97017910fa7e0e194d8", name: "Garrett" }, { _id: "57feb97817910fa7e0e194d9", name: "Steve" }, { _id: "57feb97c17910fa7e0e194da", name: "Joe" } ] 

所以,当我去/用户/史蒂夫和console.log(user) ,它为该用户logging正确的JSON。

使用.findOne或用户对象将是数组