Wix data query - column is not equal to (ne)

Hi all,

I have a searchable database which works fine. However, I would like to exclude any rows where the columns examtype1 contains the word “grammar”

I have written the below but it isn’t working.

So for example if you search for “Harvard” and Harvard exists in the database, but the examtype1 field says HARVARD GRAMMAR then the result should not show.

Can anyone see what I’ve done wrong?

function search() {

wixData.query("IndepedentSchoolExams")
    .contains("title", $w('#searchInput').value)
    .or(wixData.query("IndepedentSchoolExams").contains("schoolName2", $w('#searchInput').value))
    .and(wixData.query("IndepedentSchoolExams").ne("examType1", ("grammar")))

    .find()

Worked it out

wixData.query(“IndepedentSchoolExams”)
.contains(“title”, $w(‘#searchInput’).value)
.or(wixData.query(“IndepedentSchoolExams”).contains(“schoolName2”, $w(‘#searchInput’).value))
.not(wixData.query(“IndepedentSchoolExams”).contains(“examType1”, (“grammar”)))

    .find()