How to connect nodejs couchbase with username and password

I installed couchbase server with username (admin) and passsword(password) on my laptop.
I am creating a simple project. I can’t query my couchbase db with username and password and can’t query also.

    let cluster = new couchbase.Cluster("couchbase://");
    let nquery = couchbase.N1qlQuery;

   cluster.authenticate({username:"admin", password: "password"});
   let myBucket = cluster.openBucket("notes");
   myBucket.query(query, function(err, result) {});

Can you please help me to connect

Hey @gopimr2,

Try using this to authenticate instead:

cluster.authenticate('admin', 'password');

Cheers, Brett