Error with new CURL function on Couchbase Server 4.6

Hi, @ldoguin

Can you help me?

I’m trying to test the new CURL function using Couchbase 4.6 Docker container and I’m getting the following error:

[
  {
    "code": 3000,
    "msg": "syntax error - at (",
    "query_from_user": "SELECT count(row) FROM CURL(\"GET\",\"https://api.punkapi.com/v2/beers/1\");"
  }
]

@isha can help you with this.

try this

SELECT count(*) FROM CURL("GET","https://api.punkapi.com/v2/beers/1") a

Hi, @atom_yang

It didn’t worked.

there is an a at the end as alias.

Same error.

Hi @allysson.v1

This feature is released in 5.0.0 Developer Preview. Since you are on 4.6 you get an error.
https://www.couchbase.com/downloads
If you go to the developer tab here and download the 5.0 DP, you should be able to run the CURL command.

Thanks
Isha

1 Like

FYI

Hi,

I did resolved to try based on this article: https://blog.couchbase.com/developer-release-curl-n1ql/

But, on the other hand, I didn’t pay attention to the title of the article.

Thank you!

You can also refer to all the N1QL Dzone articles for a more detailed view on our different features/performance etc.

For CURL we have a Dzone article that was published https://dzone.com/articles/curl-comes-to-n1ql-querying-external-json-data.

This should give you examples on how to use the different options/ rest api parameters with the N1QL CURL function.

Thanks
Isha