2017-12-28 34 views
0

私はcqlで書いたこのクエリをAsync Await関数を使用して実行します。Asyncは、CassandraでNode.jsを使用して待機します

client.execute('select * from users).then(res => { 
    console.log('hello user'); 
}, err => { 
    console.log(err); 
}); 

誰かが私にこのクエリの正確な翻訳をAsync Await関数に伝えることができますか?

答えて

2

私はそれを解決しましたが、誰かを助けるかもしれないのでこの投稿を削除しません。

app.get('/', async(req,res) => { 
    const res1 = await client.execute('select * from users); 
    var user = res1.rows[0]; 
    console.log('successfull'); 
}); 
関連する問題