开发者

13027: point not in range

开发者 https://www.devze.com 2023-02-07 23:40 出处:网络
why do i get the error 13027: 开发者_StackOverflowpoint not in range when i run db:create_indexes?

why do i get the error 13027: 开发者_StackOverflowpoint not in range when i run db:create_indexes?

the index declaration in the model is index [[ :location, Mongo::GEO2D ]], :min => 200, :max => 200


This basically means one of the points in your collection is outside of the min/max that you specified. For example:

repl0:PRIMARY> db.points.insert({loc: {lat: 125, lon: 236}})

repl0:PRIMARY> db.points.ensureIndex({loc: '2d'}, {min: 126, max: 237})

point not in range

repl0:PRIMARY> db.points.ensureIndex({loc: '2d'}, {min: 125, max: 237})

in > 0

repl0:PRIMARY> db.points.ensureIndex({loc: '2d'}, {min: 124, max: 237})

In your example you also have min and max set to the same value.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号