如何在MongoDB地理空间中select查询中的字段?

我正在使用MongoDB Geospatial和node.js,并且表示查询特定点附近的最近街道。 在我的结果中,我只想select“名称”和“地址”的字段。 我试过下面的代码,但它不工作,我得到这个错误:

“未处理的拒绝错误:无法使用$select与数组”。

谢谢。

Street.find({ 'location': { $near: { $geometry: { type: 'Point', coordinates: coords }, $maxDistance: 1000 }, $select: { _id: 0, name: 1, address: 1 } } }) 

好吧,find它了:

 Street.find( { 'location': { $near: { $geometry: {type: 'Point', coordinates: coords}, $maxDistance: 1000 } } }) .select({'_id': 0, 'name': 1, 'address': 1})