ArangoJS 4 Alpha: Available Now for Testing

The first alpha of the official JavaScript driver arangojs‘ upcoming major release is now available on npm.

Version 4 streamlines the driver’s API by removing unnecessary server roundtrips to obtain references to collections and graphs that already exist:

Before:

var db = require('arangojs')();
db.collection('users')
.then(function(collection) {
 return collection.import(allTheUsers)
})
.then(function() {
 return db.collection('blogs')
})
.then(function(collection) {
 return collection.import(allTheBlogs);
})
.then(function() {
 return db.collection('articles')
})
.then(function(collection) {
 return collection.import(allTheArticles);
})
.then(handleSuccess)
.catch(handleErrors);

After:

var db = require('arangojs')();
db.collection('users').import(allTheUsers)
.then(function() {
 return db.collection('blogs').import(allTheBlogs);
})
.then(function() {
 return db.collection('articles').import(allTheArticles);
})
.then(handleSuccess)
.catch(handleErrors);

(more…)

More info...

ArangoDB JavaScript Driver 3.7: Promises & Performance

ArangoJS, the official ArangoDB JavaScript client, has been updated to version 3.7.0. The new release features significant performance improvements in Node.js and io.js. The dependency on the third-party request module has been replaced with a thin wrapper around node’s own http module, bringing a 3-4x performance improvement for consecutive requests by maintaining a connection pool.

The earlier 3.5 release also added optional support for ES6 promises. While ArangoJS does not provide a promise implementation itself, all asynchronous methods now return promises in JavaScript environments that support them – whether natively (e.g. in io.js or modern browsers) or using a polyfill like es6-promise.

The latest version of ArangoJS is available on NPM and GitHub.

More info...

Crawling GitHub with Promises: ArangoDB Tutorial

The new Javascript driver no longer imposes any promises implementation. It follows the standard callback pattern with a callback using err and res.

I wanted to give the new driver a try. A github crawler seemed like a good side-project, especially because the node-github driver follows the same conventions as the Javascript driver.

There are a lot of promise libraries out there. The most popular one – according to NPM – was promises. It should be possible to use any implementation. Therefore I used this one.

(more…)

More info...

ArangoDB Java Driver for Graphs: Enhanced Functionality

After defining a graph and filling it with some vertices and edges (see part 1), the time has come to retrieve information out of the graph.

Please take a look at the defined graph operations of ArangoDB. These will be the base for our next examples. (Yes, there may be other ways to get the results, this post does not claim completeness!)

We will start with some easy stuff and then smoothly advance in complexity.

Question: “How many edges are defined within the graph?”

(more…)

More info...

ArangoDB Java Driver: Graph Data Manipulation & Queries

With ArangoDB 2.2 the new graph API was released featuring multi collection graphs (see blog). With the new version (2.2.1) of arangodb-java-driver the new graph API is supported. In the following you can find a small example of creating a graph with Java.

For the import via maven and configuring the driver, please read the Basics and Driver Setup. For the following we assume, that arangodbDriver is a configured instance of the driver.

So let’s start the whole thing…

(more…)

More info...

ArangoDB Java Driver: Batch & Asynchronous Mode | ArangoDB Blog

The current arangodb-java-driver supports the usage of ArangoDB’s batch and asynchronous interface. This post will guide you through the usage of these features.

The batch interface

The batch interface enables the user to stack a series of calls and execute them in a batch request. Each stacked request returns a request id that can be used to retrieve the single results from the batch response. So how do you use this feature in the java driver ?

First we create an instance of the java driver:

ArangoConfigure configure = new ArangoConfigure();
configure.init();
ArangoDriver driver = new ArangoDriver(configure);

(more…)

More info...

ArangoDB Java Driver: Simplifying Database Interactions

A new arangodb-java-driver is out now, it’s on github. The driver is available for ArangoDB from version 2.2 onwards.

How to include the driver in your application ?

The driver is available as maven artifact. To add the driver to your project with maven, add the following code to your pom.xml:

<dependencies>
  <dependency>
    <groupId>com.arangodb</groupId>
    <artifactId>arangodb-java-driver</artifactId>
    <version>2.2</version>
  </dependency>
  ....
</dependencies>

(more…)

More info...

AshikawaCore 0.10 Released: Enhancements & Updates | ArangoDB

We just released version 0.10 of the low-level ArangoDB Ruby driver Ashikawa::Core. It supports both ArangoDB 1.4 and 2.0. For more details see the release notes.

We’re also working on the first version of Guacamole: It is an ODM for Rails and is based upon Ashikawa::Core.

More info...

ArangoDB PHP Driver Version 1.0 Released | ArangoDB 2012

Yesterday version 1.0 of the PHP driver for ArangoDB was released. It contains basic support for edges as well as fixes and tests. Check out the Changelog for further details. Many thanks go to Frank Mayer for his contribution! 🙂

There is also a comprehensive PHP driver tutorial available on Github.

More info...

ArangoDB for Node.js Integration | ArangoDB 2012

Note: Our new official nodejs driver is arangojs. You also can look at this blogpost about the new driver.

We got a note from Anders Elo from Sweden. He told us that he has released a ArangoDB client for node.js. Awesome! :-) You can find it on Github under the URL https://github.com/kaerus/arango-client. To install locally

npm install git://github.com/kaerus/arango-client

Anders also writes:

  • It's still lacking features and is prone to changes but it works quite nice, atleast I think so. :) I've not documented this project as of yet due to lack of time so I'll briefly instruct you by some examples.*
var arango = require('arango.client'), util = require('util');

/* Prepare a connection, defaults {protocol:'http', hostname:'127.0.0.1', port: 8529} */ 
db = new arango.Connection({name:"testcollection"});

/* we need to first create our test collection */
db.collection.create(function(err,ret){
  console.log("err(%s): ",err, ret);
});

/* create a new document in collection */
db.document.create({a:"test"},function(err,ret){
  if(err) console.log("error(%s): ", err,ret);
  else console.log(util.inspect(ret));
});

/* create a document and a new collection on demand */
db.document.create(true,"newcollection",{a:"test"},function(err,ret){
  if(err) console.log("error(%s): ", err,ret);
  else console.log(util.inspect(ret));
});

/* alternate style utilizing events */
db.document.list().on('result',function(result){
  console.log(util.inspect(result));
}).on('error',function(error){
  console.log("error(%s):", error.code, error.message);
});

The interface to the ArangoDB REST api resides in the lib/api directory. You can find out more details there. Anders also includes some tests, just runt "npm test" to execute them.

More info...

Get the latest tutorials,
blog posts and news: