shard后怎么不能使用2dsphere索引
为什么,在进行shard后,创建了2dsphere索引,但连接到mongos查询时,db.runCommand( { geoNear : "Post" ,
near : { type : "Point" ,
coordinates: } ,
spherical : true} ) ;
却报错:
"errmsg" : "no geo index :("
如果不做shard,同样的查询则没有问题。 db.runCommand( { geoNear : "Post" ,
near : { type : "Point" ,
coordinates: } ,
spherical : true} ) 找到原因了,补充在这里。
机器上装了64位,32位两套mongodb。使用32位做的shard集群就有上述问题。
停止32位的集群,删除文件,然后使用64位程序,重新做shard集群,重新导入数据,
然后测试就没有问题。
页:
[1]