On the use of COUNT function by knex

I have implemented a SQL statement that contains a COUNT function. Now I want to convert it into a KNEX statement. How can I implement it?

SELECT count("uAns") FROM test,questions WHERE test.userId ="1" AND test.queId=questions.id AND test.uAns=questions.answer

New beginners, and please give us a lot of advice. Thank you in advance.

Apr.05,2022

.count('uAns as a')
.join('questions', function() {
    this.on('questions.id', '=', 'test.queId').andOn('questions.answer', '=', 'test.uAns')
    })
.where('test.userId',userId)

after referring to the official documents, I gathered one by myself, but it was very empty. I felt that there must be something wrong. Although I got the expected data, I still looked forward to the guidance of my predecessors

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c5a4-2c335.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c5a4-2c335.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?