竞技场

This commit is contained in:
liwei1dao 2022-10-27 20:25:30 +08:00
parent 7f1197597f
commit 16f81a664f
2 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@ func (this *modelArena) Init(service core.IService, module core.IModule, comp co
bsonx.Doc{ bsonx.Doc{
{Key: "uid", Value: bsonx.Int32(1)}, {Key: "uid", Value: bsonx.Int32(1)},
}, },
bson.M{"loc": "2d"}, bson.M{"loc": "2dsphere"},
}, },
}) })
return return

View File

@ -48,7 +48,7 @@ func Test_2D(t *testing.T) {
port := []float64{2, float64(rand.Int31n(100)) / 1000.0} port := []float64{2, float64(rand.Int31n(100)) / 1000.0}
fmt.Printf("port:%v \n", port) fmt.Printf("port:%v \n", port)
if cursor, err := sys.Find(comm.TableArena, bson.M{ if cursor, err := sys.Find(comm.TableArena, bson.M{
// "dan": 2, "dan": 2,
// "loc": bson.M{ // "loc": bson.M{
// "$geoWithin": bson.M{ // "$geoWithin": bson.M{
// "$center": bson.A{port, 100}, // "$center": bson.A{port, 100},