Found a solution, This works to check a count of items:
cy.get('.datatable').find('tr').should('have.length', 4)
This does not work with the Cypress.$()
method of notation.
Reference: https://docs.cypress.io/guides/references/assertions.html#Length