Database eq code not working

I use the same code in several pages, which only displays database items that are Display==true(boolean). It works on all pages, as far as I’ve seen, but it’s not working on one page and I can’t figure out why.


this works:

import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;

$w.onReady( function () {

// HIDE / SHOW OTHERs
wixData.query(“EACexhibits”)
.eq(“display”, true )
.eq(“current”, true )
.eq(“whichGallery”,“other”)
.find()
.then((results) => {


this does not work. all items display, whether display==true or false.

// GET WIX DATA READY
import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;

$w.onReady( function () {

//if no data, hide the repeater - second Friday
wixData.query(“EACsecondFriday”)
.eq(“display”, true )
.find()
.then((results) => {


Any thoughts would be appreciated.
Thanks.

Since the code is the same, the problem is probably in the data. Make sure the data are OK (in your sandbox and in live).

1 Like

I verified that display is boolean. The live db only has four items currently; three display==false and one display==true. but all four are displayed.

what do you have in the "then’ block of you query promise?

1 Like

@jonatandor35 Yet another rookie mistake.
While the code was correct, I had forgotten to disconnect the relevant repeater fields from the database. They were still connected with no filter. This connection seems to override the code. Once I added the display==true filter to my database connection, things work as desired.
Thanks JD for your attention.