Skip to content

Commit

Permalink
- PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
BorisDog committed Jan 18, 2023
1 parent fee61f3 commit 7c7b0f8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/MongoDB.Driver/Search/OperatorSearchDefinitions.cs
Expand Up @@ -141,8 +141,8 @@ internal sealed class GeoShapeSearchDefinition<TDocument, TCoordinates> : Operat

public GeoShapeSearchDefinition(
SearchPathDefinition<TDocument> path,
GeoJsonGeometry<TCoordinates> geometry,
GeoShapeRelation relation,
GeoJsonGeometry<TCoordinates> geometry,
SearchScoreDefinition<TDocument> score)
: base(OperatorType.GeoShape, path, score)
{
Expand Down
8 changes: 4 additions & 4 deletions src/MongoDB.Driver/Search/SearchDefinitionBuilder.cs
Expand Up @@ -185,11 +185,11 @@ public sealed class SearchDefinitionBuilder<TDocument>
/// <returns>A geo shape search definition.</returns>
public SearchDefinition<TDocument> GeoShape<TCoordinates>(
SearchPathDefinition<TDocument> path,
GeoJsonGeometry<TCoordinates> geometry,
GeoShapeRelation relation,
GeoJsonGeometry<TCoordinates> geometry,
SearchScoreDefinition<TDocument> score = null)
where TCoordinates : GeoJsonCoordinates =>
new GeoShapeSearchDefinition<TDocument, TCoordinates>(path, geometry, relation, score);
new GeoShapeSearchDefinition<TDocument, TCoordinates>(path, relation, geometry, score);

/// <summary>
/// Creates a search definition that queries for shapes with a given geometry.
Expand All @@ -208,14 +208,14 @@ public sealed class SearchDefinitionBuilder<TDocument>
/// <returns>A geo shape search definition.</returns>
public SearchDefinition<TDocument> GeoShape<TCoordinates, TField>(
Expression<Func<TDocument, TField>> path,
GeoJsonGeometry<TCoordinates> geometry,
GeoShapeRelation relation,
GeoJsonGeometry<TCoordinates> geometry,
SearchScoreDefinition<TDocument> score = null)
where TCoordinates : GeoJsonCoordinates =>
GeoShape(
new ExpressionFieldDefinition<TDocument>(path),
geometry,
relation,
geometry,
score);

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions tests/MongoDB.Driver.Tests/Search/AtlasSearchTests.cs
Expand Up @@ -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");
Expand Down
Expand Up @@ -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' } }");
}

Expand All @@ -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' } }");
}

Expand Down

0 comments on commit 7c7b0f8

Please sign in to comment.