3

What tool do I use to execute the code shown in the Examples in the ArangoDB Documentation for Inserting Documents using the HTTP API. I thought it was arangosh.exe but not so sure anymore.

For example: The Arango 3.3 HTTP Bulk Import Documentation examples look like this:

enter image description here

In the examples I see

shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/import?collection=products

I am assuming (Most likely assuming incorrectly) that the examples are using the Arango Shell which can be opened using arangosh.exe from the command prompt.

Below is a successful login into Arango using the Arango Shell. enter image description here

Next is my attempt to use the syntax shown in the examples contained within the API ArangoDB documentation. enter image description here

What am I doing wrong here?

2 Answers 2

5

To use the HTTP API, you need some tool to issue HTTP requests with different methods (GET, POST, PUT, DELETE), potentially with protocol-typical authentication and payload.

curl is such a tool. In case of Windows as operating system, it is not available by default. You can download builds for various OS here: https://curl.haxx.se/download.html

It is a command line tool. Run it in a shell, i.e. command prompt or Powershell on Windows. You can not run it inside of arangosh! The ArangoDB shell is essentially a JavaScript REPL shell to interact with ArangoDB using a JavaScript interface. You can't run commands like in a OS shell here.

Sign up to request clarification or add additional context in comments.

1 Comment

That's it man. I knew it was something silly like this and I had a 90% hunch that I was not to use the Arango Shell for this purpose but I didn't know what curl was or that it was even a thing. Thanks for the clarification.
3

Please also note that there is a tool of its own for importing data from files into ArangoDB. The tool is named arangoimp (or arangoimport in current devel). It is installed alongside with ArangoDB on Windows and other platforms.

arangoimp.exe can be invoked from Powershell or a command prompt. More details can be found in the manual. But again, arangoimp is not supposed to be started from inside the ArangoShell (arangosh), but from Powershell or a command prompt!

3 Comments

Yeah I've played around with Arangoimp and got it to work. I originally did the same thing as I did here when I attempted to use the Arango Shell instead of Arangoimp. My issue with Arangoimp is that it can only import 'Files'. I need a direct import which is now why I'm working with the Arango API.
Is your data source some common database system, such as MySQL?
I'm currently working with an Oracle Express instance installed on my local machine to get the hang of things. In my production environment we are not able to utilize the local file system which is why I cannot utilize arangoimp.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.