Guest passwords and member passwords

Well, I guess I’m lost. I have a database with four fields: User Name, Email, ID (automatically generated by Wix), and fileURL. I can grab the current user and the page location as follows:

let user = wixUsers.currentUser;
let userId = user.id;

let url = wixLocation.url;

Now I want to look in my database for the user, and check the vale of the fileURL for that user. If the user is in the database and has that URL in the fileURL field, I want to let him look at the page, otherwise I want to put out an error or in some other way prevent the user from seeing the data on the page. My Javascript is limited. I’m not sure how to query my database to determine a) if the user is in it and b) (if the user is in the database ) what is the user’s fileURL. Once I have that, I’m assuming I could do an if statement to check if the two were equal urls were equal. Can someone point me in the right direction for such a query? An example would be great.

Thanks–

Al