【问题标题】:Async Await in Cassandra using Node.js使用 Node.js 在 Cassandra 中异步等待
【发布时间】:2018-06-08 19:07:54
【问题描述】:

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

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

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

【问题讨论】:

    标签: node.js cassandra async-await


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2017-02-19
      • 2021-03-26
      • 1970-01-01
      • 2019-04-22
      • 2019-01-15
      • 1970-01-01
      • 2013-08-03
      • 1970-01-01
      • 2014-02-15
      相关资源
      最近更新 更多