Runtime Error in Java Developer Console

What does this mean?

and what caused it?

Code:

import wixData from ‘wix-data’
let userId;
let loginEmail;
$w.onReady( function () {
});

export function submitButton_click(event) {
let inputEmail = $w(“#input1”.value)
console.log("Getting ID for " , inputEmail)

wixData.query(“Members/PrivateMembersData”)
.eq(loginEmail,$w(“#input1”.value) )
.find()
.then((res) => {
userId=res._id
loginEmail=res.loginEmail
console.log(userId)
console.log(loginEmail)
$w(“#wixLogin”).text = res.loginEmail
$w(“#wixID”).text = res.wixEmail
})
}

Hello

See below. Also, what are you trying to achieve? you seem to be getting the login email just to return the same email?

let inputEmail = $w("#input1".value)

Needs to be

let inputEmail = $w("#input1").value
.eq(loginEmail,$w("#input1".value)  )

Needs to be

.eq("loginEmail", $w("#input1").value)

Oops… This s embarrassing, I should know better. Thats definitely a Rookie error! Just fiddling around with trying to grab a users ID in order to better understand how the email users functions work.

Made the change but still returns error:
“WDE0048: Invalid .eq field value [Undefined]. .eq field must be a String.”
Thanks
JD

The first argument to eq() should be of type string and match the appropriate column name in the database. So you should probably be passing “loginEmail” (with quotes) and not the undefined variable loginEmail.

Also we’re coding in Javascript. Java is a completely unrelated language. If you enjoy type errors you should spend some time with Java. :blush:

Just realised it was you JD sorry mate haha,

See my last comment, last code block, if the field is loginEmail then do the below (with quotations) as lee mentioned

.eq("loginEmail", $w("#input1").value)