question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Case-insensitive equals

See original GitHub issue

Is your feature request related to a problem? Please describe. Since we have case-insensitive contains and case-insensitive starts/ends with, it would be really nice to just be able to case-insensitive compare!

Describe the solution you’d like Perhaps value__iequals="ThE VaLuE"

Describe alternatives you’ve considered Using startswith/endswith would obviously be error prone

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
frankie567commented, Jul 9, 2020

It seems the doc is wrong here. From what I see in the code, it seems the filter is called iexact, not iequals:

https://github.com/tortoise/tortoise-orm/blob/5627f11c7df4907d9b12dcd369769226a7b6219b/tortoise/filters.py#L345-L350

2reactions
BoberModcommented, Jun 28, 2020

I found iequals in doc of 0.16.13 https://tortoise-orm.readthedocs.io/en/latest/query.html?highlight=iequals#filtering But I cant use it and got exception Unknown filter param 'username__iequals'. Allowed base values are ['id' ... 'username' ...]. I have installed 0.16.13, but it’s not available.

So, which option is correct?

  1. I’m using it incorrectly. But how is this possible, there is no explanation for this in the documentation.
  2. The documentation is incorrect and tortoise still can’t do a case-insensitive search.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a C# case insensitive equals operator? - Stack Overflow
If Microsoft developers see this, I think there is a need for a case-insensitive operator in the next version of csharp. This string.Equal()...
Read more >
Java String equalsIgnoreCase() method - HowToDoInJava
In equalsIgnoreCase() method, two strings are considered equal if they are of the same length and corresponding characters in the two strings ...
Read more >
(equals) string operator - The case-insensitive - Microsoft Learn
Learn how to use the =~ (equals) operator to filter a record set for data with a case-insensitive string.
Read more >
Compare Two JavaScript Strings, Ignoring Case - Mastering JS
The most basic way to do case insensitive string comparison in JavaScript is using either the toLowerCase() or toUpperCase() method to make sure ......
Read more >
Case-sensitive and Case-insensitive String Comparisons in ...
Case -Insensitive Equals (-eq). You can use -eq to perform a case-insensitive string comparison. ❯ "Ivan Kahl's Blog" -eq "ivan kahl's BLOG" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found