最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Async使用Node.js在Cassandra中等待

运维笔记admin9浏览0评论

Async使用Node.js在Cassandra中等待

Async使用Node.js在Cassandra中等待

我想通过使用Async Await函数执行我在cql中编写的查询。

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

有人能告诉我这个查询到Async Await函数的确切翻译。

回答如下:

我解决了它,但我没有删除这篇文章,因为它可能会帮助某人。

app.get('/', async(req,res) => {
    const res1 = await client.execute('select * from users);
    var user = res1.rows[0];
    console.log('successfull');
});
发布评论

评论列表(0)

  1. 暂无评论