How to ignore case using FilterQueryOp breeze

I am using the breeze to request data from the server and it seems to run into problems. Is there a way to filter this data and ignore cases or make a value from a lowercase field? Example:

var term = "john"; 
query = query.where("Name", "contains", Term);

The problem I am facing is that if the "Name" field contains John with the capital "J", it returns false, but returns true if I change the term to "John". I know this is a question, but how can I make the wind ignore the hull? without using jquery.each.

Thanks. Any help would be greatly appreciated.

+4
source share
3 answers

, . Breeze LocalQueryComparisonOptions, .

    var lqco = new breeze.LocalQueryComparisonOptions({
        name: "custom comparison options",
        isCaseSensitive: false,
        usesSql92CompliantStringComparison: true
    });
    // either apply it globally
    lqco.setAsDefault();
    // or to a specific MetadataStore
    var ms = new breeze.MetadataStore({ localQueryComparisonOptions: lqco });
    var em = new breeze.EntityManager( { metadataStore: ms });

. , , .

, , "" ( ), , .

, Breeze , localQueryComparferences, .

, .

+3

-, .

OData , . , , :

var term = "john"; 
query = query.where("tolower(Name)", breeze.FilterQueryOp.Contains, term.toLowerCase());

, OData , , .

+3

- Oracle, Jay Traband, , . :

ALTER SESSION SET nls_comp = ;  ALTER SESSION SET nls_sort = binary_ci

, -. !!!

+1

All Articles