How can allow users query their own data in the database? The following code queries all data even data from other users.
import wixData from 'wix-data';
wixData.query("confirm")
.find()
.then((result) => {
if (result.items[0].confirm <1) {
$w("#button1133").show()
$w("#text7").hide();
} else {
$w("#button1133").hide()
$w("#text7").text = "You have already undertaken today's survey";
}
})
Any help will be appreciated.
You need to put an actual query function underneath the wixData,query("yourdatasetname) line of code, before the .find() line.
See the API reference section for more info.
https://www.wix.com/corvid/reference/wix-data.WixDataQuery.html
See these previous posts too.
https://www.wix.com/corvid/forum/community-discussion/code-to-allow-user-account-to-fill-a-form-just-one-time
https://www.wix.com/corvid/forum/community-discussion/how-to-limit-submissions-per-user