How to execute runCommand with Mongoose?

前端 未结 4 502
一生所求
一生所求 2021-02-07 13:28

I am using Node.js and Mongoose to access my MongoDB. I am using a model that stores some geo coordinates. I have them indexed and everything seems to work as expected. What I a

4条回答
  •  渐次进展
    2021-02-07 13:49

    I don't think Mongoose supports runCommand right now. You would be better off using the geospatial options using the find method e.g. >

    db.places.find( { location : { $near : [50,50] , $maxDistance : 300 } } )
    

提交回复
热议问题