Node.js MongoDB和Mongoose中边界框的数据类型?

Node.js MongoDB和Mongoose中边界框的数据类型?,node.js,mongodb,mongoose,geojson,Node.js,Mongodb,Mongoose,Geojson,我正在考虑在MongoDB中存储一个引用路由的条目,该条目存储在外部文件中,但在数据库中具有该路由的边界框。我不确定是否应该为此使用多边形,或者是否有更好的数据类型?需要考虑的主要问题是,这将用于搜索。例如,路线是区域的搜索。起点和终点是不够的,因为它们不一定代表范围(例如,轨迹可以在起点处结束) 我使用的是and 到目前为止,我有一些类似于: const mongoose = require('mongoose'); const mongooseGeoJSON = require('mongo

我正在考虑在MongoDB中存储一个引用路由的条目,该条目存储在外部文件中,但在数据库中具有该路由的边界框。我不确定是否应该为此使用多边形,或者是否有更好的数据类型?需要考虑的主要问题是,这将用于搜索。例如,路线是区域的搜索。起点和终点是不够的,因为它们不一定代表范围(例如,轨迹可以在起点处结束)

我使用的是and

到目前为止,我有一些类似于:

const mongoose = require('mongoose');
const mongooseGeoJSON = require('mongoose-geojson-schema');

const hikeSchema = mongoose.Schema({
    title: String,
    description: String,
    when: Date,
    startPoint: mongoose.Schema.Types.Point,
    endPoint: mongoose.Schema.Types.Point,
    boundingBox: //Not sure?
});

更新:现在我只打算使用多边形类型,没有更好的建议

请注意,如果你最后出现在这里,这就是我使用的(mongoose 3.6)-仍然使用多边形,但我怀疑这是正确的方式:

Place.where('location').intersects().geometry({
    type: "Polygon",
    coordinates: [[
        [ minLongitude, minLatitude ],
        [ minLongitude, maxLatitude ],
        [ maxLongitude, maxLatitude ],
        [ maxLongitude, minLatitude ],
        [ minLongitude, minLatitude ]
    ]]
}).exec()