最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

Async使用Node.js在Cassandra中等待

IT培训 admin 9浏览 0评论

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');
});

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. 暂无评论