Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overcoming MaxNodeCount > 100 limit in BreezeJS

For testing purposes I'm querying the term 'test' within a table on several columns. The filter url generated looks like this:

$filter=(substringof('test',Column1) eq true)) and (substringof('test',Column2) eq true)) and (substringof('test',Column3) eq true)) ...

The query works fine until the number of columns queried exceeds 15. At this point I get the following error message:

Query failed: The node count limit of '100' has been exceeded. To increase the limit, set the 'MaxNodeCount' property on QueryableAttribute or ODataValidationSettings.

I got around it by adding the following attribute to the api method being called:

[Queryable(
    AllowedQueryOptions = AllowedQueryOptions.All,
    AllowedFunctions = AllowedFunctions.AllFunctions,
    MaxNodeCount = 200)]

But this does not seem to play well with foreign entities. They are always null when using the expand function. I checked the resulting filter url and it does include the necessary $expand syntax.

Is there anything else I'm missing?

like image 281
Ziad Avatar asked Jan 13 '23 23:01

Ziad


2 Answers

update your controller method with this attribute:

[EnableBreezeQuery( MaxNodeCount = 200)]

like image 70
Amirreza Avatar answered Jan 26 '23 00:01

Amirreza


Are you sure $expand works when there is no MaxNodeCount set?

If you use WebAPI, $expand won't do anything for you, you will have response from server like:

SelectedSubItem=null

Instead, try going into your model and instead of returning

return Context.MyClass;

do this:

return Context.MyClass.Include("SelectedSubItem");
like image 45
Dominictus Avatar answered Jan 26 '23 02:01

Dominictus