Fetching specific data based on users email address

@financialacademyca it can be many thing.

  1. Make sure you’re logged in

  2. Make sure your email appears in the collection (without extra spaces).

  3. Check your collection permission.

  4. Sync sandbox with live site.

  5. Also it’s a better practice to chain promises and not to net them so:

import wixLocation from 'wix-location';
import wixUsers from 'wix-users';
import wixData from 'wix-data';

export function button9_click(event) {
 let user = wixUsers.currentUser;
 if(user){
        user.getEmail()
        .then(email => {
            return wixData.query("Files")
            .eq("studentEmailAddress", email)
            .find();
        })
.	.then( (results) => {
                console.log(results.totalCount);
            } );
    }
}