1. 范围查询: 类似sql: between and ... ( 30<x<40 ) 举例: filter := bson.D{{"cid", cid}, {"height", bson.M{"$gte": startheight, "$lt": endheight}}} 2.包含查询: 类似sql: where id in(.........)
举例: countFilter := bson.M{"cid": bson.M{"$in": queryIds}} 3.或者关系查询: 类似sql: where c1="X" or c2="X"
举例: filter=bson.D{{"cid", cid},{"$or",[]interface{}{bson.D{{"from",info.Address}},bson.D{{"to",info.Address}}}}}