cannot query on strings in v5
See original GitHub issueSystem.NotSupportedException: "Method CompareString not available to convert to BsonExpression (CompareString(x.Name, value(testLiteDB.MainWindow+_Closure$__0-0).$VB$Local_customer.Name, False))."
how to reproduce: just perform any kind of query (Query/Find/FindOne) on a string property, using Lambda-Epressions. works in v4.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to listen to query param change event in react-router v5
I'd like to be able to listen to query param change events, preferably via a hook, but anything would be nice. I can't...
Read more >Query Strings with React Router v5 - YouTube
... Strings (Solution) Query Strings Pass props to React Router v5's ... Rendering with React and React Router v5 Fixing the ' cannot...
Read more >Query String Error
I'm getting this error which is prohibiting any events being displayed. My server is running php v7.4, mysql v5.6.x on WP 5.7.2, amr...
Read more >A Guide to Query Strings with React Router - ui.dev
In this up-to-date guide, you'll learn what query strings are and how to use them using React Router's useSearchParams Hook.
Read more >Getting Query Strings (Search Params) in React Router
The URLSearchParams object has a few methods that we can use to get a single value, the .get() method. If we assume this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@BangL In C#, the equality operator is a “real” operator and the BsonMapper successfully converts it to a to an expression. However, in VB, the string equality operator is converted to a call to
CompareString
, and the BsonMapper doesn’t know what to do with it.In previous versions of LiteDB, lambdas that were not sucessfully converted to expressions were stored and executed after the results were retrieved and mapped to object. However, this feature was removed in v5 due to performance issues - if you ran your query on a collection with 1 million entries, all of them would be retrieved before the lambda expression was executed, which is very inefficient.
This feature may be recreated in v5.1 in a more efficient way, however please note that there might be a significant performance hit.
very good to know. thanks for the explanation! for me personally this problem is solved then, i will go BsonExpressions only from now on.
because of the performance issues and the vb.net incompatiblity, i would suggest putting the [ObsoleteAttribute] onto the lambda overloads though.