How to Create a Search for Your Database

I am having an issue with getting this code sample to work on my site. I am still working on it so it isn’t live.

I have read this:
https://www.wix.com/corvid/forum/corvid-tips-and-updates/example-search-a-database
Here is my code:

$w(‘#dataset1’).setFilter(newFilter);
let foo = $w(‘#dataset1’);
console.log(“=-=-=-=-=-=”);
console.log(foo);
console.log(“=-=-=-=-=-=”);

Here is what I get in the console when I run in preview:
=-=-=-=-=-=
{…}
id:
“dataset1”
type:
“dataset”
global:
true
=-=-=-=-=-=

My first question is that when I am previewing, am I using the sandbox DB or the live DB?
For whatever reason, I can’t sync my sandbox db to live.

Here is the other thing, does anyone have a better way of testing than above? I want to see the contents of the filter object.

Finally, I am assuming that when I open the page, I am getting however many default rows from the table I am querying. That works fine. But then when I get the object back from setFilter, how does my repeater “know” what to display? I am not getting any results from setFilter, or at least none are displaying when filtered. I get the right amount of results when no filtering.

Thanks in advance for any help.

When previewing your site you see your Sandbox Database. Make sure to publish your site after syncing in order for the changes to go live. You can find more information about it here:
https://support.wix.com/en/article/accessing-your-sandbox-and-live-database-collections
https://support.wix.com/en/article/syncing-data-between-sandbox-and-live-database-collections

Please note, that you need to check if your newFilter function is set up correctly. You can provide us with its code, so we can check it out.

Please also check out these references with an explanation and examples for the functions that you are using:
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#setFilter
https://www.wix.com/corvid/reference/wix-data.html#filter

As for your question about displaying content in a repeater, here is a reference that will help you:
https://www.wix.com/corvid/reference/$w.Repeater.html#data