Skip to content

[Bug]: LIMIT doesn't get correctly applied to string queries #2755

@nirinchev

Description

@nirinchev

What happened?

Using a string query with LIMIT ignores the limit when .Count() is invoked in LINQ.

Repro steps

realm.Write(() =>
{
    Enumerable.Range(0, 10_000).ToList().ForEach(_ =>
    {
        realm.Add(new Item());
    });
});

var items = realm.All<Item>().Filter("TRUEPREDICATE LIMIT(1)");
Assert.That(items.Count(), Is.EqualTo(1)); // Fails

Version

10.7.1

What SDK flavour are you using?

Local Database only

What type of application is this?

Console/Server

Client OS and version

All

Code snippets

No response

Stacktrace of the exception/crash you're getting

No response

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions