Craft 3 - Searching by date field - Calling unknown method: craft\behaviors\ElementQueryBehavior On a website upgraded to Craft 3 - having issues pulling events by date.

Error Is:

Calling unknown method: craft\behaviors\ElementQueryBehavior::eventDate()


The Error occurs on the last line of my code below.
I'm done alot of searching but unable to find the correct method I should be using now.

    {% if (category is defined) and (category is not empty) %}
    {% set params = { section: 'events', orderBy: 'eventDate', relatedTo: category } %}
    {% else %}
    {% set params = { section: 'events', orderBy: 'eventDate' } %}
    {% endif %}          
    {% set j = 0 %}
    {# Retrieve all of the events for the month, and group them by day #}
    {% set groupedEvents = craft.entries(params).eventDate('and', '&gt;= ' ~ startdate, '&lt;= ' ~ enddate) | group('eventDate|date("Y-m-d")') %}


UPDATE
Ok think found the issue - needed square brackets.

{% set groupedEvents = craft.entries(params).eventDate(['and', '&gt;= ' ~ startdate, '&lt;= ' ~ enddate]) | group('eventDate|date("Y-m-d")') %}
Was missing the square brackets 

{% set groupedEvents = craft.entries(params).eventDate(['and', '&gt;= ' ~ startdate, '&lt;= ' ~ enddate]) | group('eventDate|date("Y-m-d")') %}