Пример #1
0
    def test_index_geo2dsphere(self):
        coll = self.coll
        geo_ix = yield coll.create_index(qf.sort(qf.GEO2DSPHERE("loc")))

        self.assertEqual("loc_2dsphere", geo_ix)
        index_info = yield coll.index_information()

        self.assertEqual(index_info["loc_2dsphere"]["key"],
                         {"loc": "2dsphere"})
Пример #2
0
    def test_index_geo2dsphere(self):
        db = self.db
        coll = self.coll
        yield coll.drop_indexes()
        geo_ix = yield coll.create_index(filter.sort(
            filter.GEO2DSPHERE("loc")))

        self.assertEqual('loc_2dsphere', geo_ix)

        index_info = yield coll.index_information()
        self.assertEqual([('loc', '2dsphere')], index_info['loc_2dsphere'])
Пример #3
0
 def test_SortGeoIndexes(self):
     self.assertEqual(qf.sort(qf.GEO2D('x')), qf.sort([('x', "2d")]))
     self.assertEqual(qf.sort(qf.GEO2DSPHERE('x')),
                      qf.sort([('x', "2dsphere")]))
     self.assertEqual(qf.sort(qf.GEOHAYSTACK('x')),
                      qf.sort([('x', "geoHaystack")]))