A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.mongodb.com/docs/realm-sdks/dotnet/latest/reference/Realms.QueryMethods.html below:

Class QueryMethods | Realm

Class QueryMethods

Provides methods that get translated into native Realm queries when using LINQ.

Namespace: Realms Assembly: Realm.dll Syntax
public static class QueryMethods
Methods | Edit this page View Source Contains(string?, string, StringComparison)

Returns a value indicating whether a specified substring occurs within this string.

Declaration
public static bool Contains(string? str, string value, StringComparison comparisonType)
Parameters Type Name Description string str

The original string.

string value

The string to seek.

StringComparison comparisonType

One of the enumeration values that determines how this string and value are compared.

Returns Type Description bool

true if the value parameter occurs within this string, or if value is the empty string (""); otherwise, false.

Exceptions | Edit this page View Source FullTextSearch(string?, string)

Performs a 'simple term' Full-Text search on a string property.

Declaration
public static bool FullTextSearch(string? str, string terms)
Parameters Type Name Description string str

The string to compare against the terms.

string terms

The terms to look for in str.

Returns Type Description bool

true if the string matches the terms; false otherwise.

Examples
var matches = realm.All<Book>().Where(b => b.Summary.FullTextSearch("fantasy novel"));
| Edit this page View Source GeoWithin(IEmbeddedObject?, GeoShapeBase)

Checks whether geoShape contains the point represented by an embedded object.

Declaration
public static bool GeoWithin(IEmbeddedObject? point, GeoShapeBase geoShape)
Parameters Type Name Description IEmbeddedObject point

An embedded object that has the shape of a GeoJson point. It must have at least two fields - IList<double> coordinates and string type. The shape of the object will be verified at runtime.

GeoShapeBase geoShape

One of GeoBox, GeoCircle, or GeoPolygon representing the shape that point will be checked against.

Returns Type Description bool

true if point is contained in geoShape; false otherwise.

Examples

An example embedded object that can be used in geospatial queries is:

public partial class MyGeoPoint : IEmbeddedObject
{
    [MapTo("coordinates")]
    private IList<double> Coordinates { get; } = null!;

    [MapTo("type")]
    private string Type { get; set; } = "Point";

    public double Latitude => Coordinates.Count > 1 ? Coordinates[1] : throw new Exception($"Invalid coordinate array. Expected at least 2 elements, but got: {Coordinates.Count}");

    public double Longitude => Coordinates.Count > 1 ? Coordinates[0] : throw new Exception($"Invalid coordinate array. Expected at least 2 elements, but got: {Coordinates.Count}");

    public MyGeoPoint(double latitude, double longitude)
    {
        Coordinates.Add(longitude);
        Coordinates.Add(latitude);
    }
}

Note that if you're using Sync, the name of the embedded object type must match exactly the title of the embedded object defined in the GeoJson Schema on the server.

| Edit this page View Source Like(string?, string, bool)

Performs a 'like' comparison between the specified string and pattern.

Declaration
public static bool Like(string? str, string pattern, bool caseSensitive = true)
Parameters Type Name Description string str

The string to compare against the pattern.

string pattern

The pattern to compare against.

bool caseSensitive

If set to true performs a case sensitive comparison.

Returns Type Description bool

true if the string matches the pattern, false otherwise.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4