Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

254
Views
passing string parameter error in node-postgres (pg) client

I am querying potgres in javascript. I passing string as a parameter but getting empty resultset. I have tried even using lodash toString method to no avail. however when I run the query in pgadmin i get a record.

User.getIdByPhone = function (phone, callback){
    if(!phone) return;
    email = _.toString(phone);
    pg.query('SELECT id FROM users WHERE phone = $1', [phone], function (err, results) {
        if (err){
            console.log('error on UserRule: 83', err)
            return callback(false, true);
        }
        try{
            if(!_.isUndefined(results.rows[0]))
                callback(results.rows[0].id, false);
            else 
                callback(false, true)
        }
        catch(e){
            console.log(e)
        }
    });
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!