From 7c7b0f81d2153c8ef0ab271e65832e2130d86439 Mon Sep 17 00:00:00 2001 From: BorisDog Date: Wed, 18 Jan 2023 11:31:31 -0800 Subject: [PATCH] - PR comments --- .../Search/OperatorSearchDefinitions.cs | 2 +- src/MongoDB.Driver/Search/SearchDefinitionBuilder.cs | 8 ++++---- .../MongoDB.Driver.Tests/Search/AtlasSearchTests.cs | 4 ++-- .../Search/SearchDefinitionBuilderTests.cs | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/MongoDB.Driver/Search/OperatorSearchDefinitions.cs b/src/MongoDB.Driver/Search/OperatorSearchDefinitions.cs index 0ce3c79be5e..de3ac5a9b14 100644 --- a/src/MongoDB.Driver/Search/OperatorSearchDefinitions.cs +++ b/src/MongoDB.Driver/Search/OperatorSearchDefinitions.cs @@ -141,8 +141,8 @@ internal sealed class GeoShapeSearchDefinition : Operat public GeoShapeSearchDefinition( SearchPathDefinition path, - GeoJsonGeometry geometry, GeoShapeRelation relation, + GeoJsonGeometry geometry, SearchScoreDefinition score) : base(OperatorType.GeoShape, path, score) { diff --git a/src/MongoDB.Driver/Search/SearchDefinitionBuilder.cs b/src/MongoDB.Driver/Search/SearchDefinitionBuilder.cs index bad1f530613..b7c3fb8cf2d 100644 --- a/src/MongoDB.Driver/Search/SearchDefinitionBuilder.cs +++ b/src/MongoDB.Driver/Search/SearchDefinitionBuilder.cs @@ -185,11 +185,11 @@ public sealed class SearchDefinitionBuilder /// A geo shape search definition. public SearchDefinition GeoShape( SearchPathDefinition path, - GeoJsonGeometry geometry, GeoShapeRelation relation, + GeoJsonGeometry geometry, SearchScoreDefinition score = null) where TCoordinates : GeoJsonCoordinates => - new GeoShapeSearchDefinition(path, geometry, relation, score); + new GeoShapeSearchDefinition(path, relation, geometry, score); /// /// Creates a search definition that queries for shapes with a given geometry. @@ -208,14 +208,14 @@ public sealed class SearchDefinitionBuilder /// A geo shape search definition. public SearchDefinition GeoShape( Expression> path, - GeoJsonGeometry geometry, GeoShapeRelation relation, + GeoJsonGeometry geometry, SearchScoreDefinition score = null) where TCoordinates : GeoJsonCoordinates => GeoShape( new ExpressionFieldDefinition(path), - geometry, relation, + geometry, score); /// diff --git a/tests/MongoDB.Driver.Tests/Search/AtlasSearchTests.cs b/tests/MongoDB.Driver.Tests/Search/AtlasSearchTests.cs index dbfb795ef7f..6753c956278 100644 --- a/tests/MongoDB.Driver.Tests/Search/AtlasSearchTests.cs +++ b/tests/MongoDB.Driver.Tests/Search/AtlasSearchTests.cs @@ -167,8 +167,8 @@ public void GeoShape() var results = GeoSearch( GeoBuilders.Search.GeoShape( x => x.Address.Location, - __testPolygon, - GeoShapeRelation.Intersects)); + GeoShapeRelation.Intersects, + __testPolygon)); results.Count.Should().Be(25); results.First().Name.Should().Be("Ribeira Charming Duplex"); diff --git a/tests/MongoDB.Driver.Tests/Search/SearchDefinitionBuilderTests.cs b/tests/MongoDB.Driver.Tests/Search/SearchDefinitionBuilderTests.cs index 25be93f1aee..95d7e9bd377 100644 --- a/tests/MongoDB.Driver.Tests/Search/SearchDefinitionBuilderTests.cs +++ b/tests/MongoDB.Driver.Tests/Search/SearchDefinitionBuilderTests.cs @@ -297,8 +297,8 @@ public void GeoShape() AssertRendered( subject.GeoShape( "location", - __testPolygon, - GeoShapeRelation.Disjoint), + GeoShapeRelation.Disjoint, + __testPolygon), "{ geoShape: { geometry: { type: 'Polygon', coordinates: [[[-161.323242, 22.512557], [-152.446289, 22.065278], [-156.09375, 17.811456], [-161.323242, 22.512557]]] }, path: 'location', relation: 'disjoint' } }"); } @@ -310,14 +310,14 @@ public void GeoShape_typed() AssertRendered( subject.GeoShape( x => x.Location, - __testPolygon, - GeoShapeRelation.Disjoint), + GeoShapeRelation.Disjoint, + __testPolygon), "{ geoShape: { geometry: { type: 'Polygon', coordinates: [[[-161.323242, 22.512557], [-152.446289, 22.065278], [-156.09375, 17.811456], [-161.323242, 22.512557]]] }, path: 'location', relation: 'disjoint' } }"); AssertRendered( subject.GeoShape( "Location", - __testPolygon, - GeoShapeRelation.Disjoint), + GeoShapeRelation.Disjoint, + __testPolygon), "{ geoShape: { geometry: { type: 'Polygon', coordinates: [[[-161.323242, 22.512557], [-152.446289, 22.065278], [-156.09375, 17.811456], [-161.323242, 22.512557]]] }, path: 'location', relation: 'disjoint' } }"); }