home shape

ArangoDB 2.8 Beta 3: Test New Features

ArangoDB 2.8 (beta3) is available for testing.

The last beta release of ArangoDB 2.8 – at least for 2015 – comes with the following bugfixes and improvements:

  • web interface: fixed a graph display bug concerning dashboard view
  • web interface: fixed several bugs during the dashboard initialize process

  • web interface: included several bugfixes: #1597, #1611, #1623
  • added --create-collection-type option to arangoimp

    This allows specifying the type of the collection to be created when --create-collection is set to true.

  • AQL query optimizer now converts LENGTH(collection-name) to an optimized expression that returns the number of documents in a collection
  • slightly adjusted V8 garbage collection strategy so that collection eventually happens in all contexts that hold V8 external references to documents and collections.

    also adjusted default value of --javascript.gc-frequency from 10 seconds to 15 seconds, as less internal operations are carried out in JavaScript.

  • fixes for AQL optimizer and traversal
  • Foxx export cache should no longer break if a broken app is loaded in the web admin interface.
  • adjusted the behavior of the expansion ([*]) operator in AQL for non-array values

    In ArangoDB 2.8, calling the expansion operator on a non-array value will always return an empty array. Previous versions of ArangoDB expanded non-array values by calling the TO_ARRAY() function for the value, which for example returned an array with a single value for boolean, numeric and string input values, and an array with the object’s values for an object input value. This behavior was inconsistent with how the expansion operator works for the array indexes in 2.8, so the behavior is now unified:

    • if the left-hand side operand of [*] is an array, the array will be returned as is when calling [*] on it
    • if the left-hand side operand of [*] is not an array, an empty array will be returned by [*]

    AQL queries that rely on the old behavior can be changed by either calling TO_ARRAY explicitly or by using the [*] at the correct position.

    The following example query will change its result in 2.8 compared to 2.7:

    LET values = “foo” RETURN values[*]

In 2.7 the query has returned the array [ "foo" ], but in 2.8 it will return an empty array [ ]. To make it return the array [ "foo" ] again, an explicit TO_ARRAY function call is needed in 2.8 (which in this case allows the removal of the [*] operator altogether). This also works in 2.7:

  LET values = "foo" RETURN TO_ARRAY(values)

Another example:

  LET values = [ { name: "foo" }, { name: "bar" } ]
  RETURN values[*].name[*]

The above returned [ [ "foo" ], [ "bar" ] ] in 2.7. In 2.8 it will return [ [ ], [ ] ], because the value of name is not an array. To change the results to the 2.7 style, the query can be changed to

  LET values = [ { name: "foo" }, { name: "bar" } ]
  RETURN values[* RETURN TO_ARRAY(CURRENT.name)]

The above also works in 2.7. The following types of queries won’t change:

  LET values = [ 1, 2, 3 ] RETURN values[*] 
  LET values = [ { name: "foo" }, { name: "bar" } ] RETURN values[*].name
  LET values = [ { names: [ "foo", "bar" ] }, { names: [ "baz" ] } ] RETURN values[*].names[*]
  LET values = [ { names: [ "foo", "bar" ] }, { names: [ "baz" ] } ] RETURN values[*].names[**]
Ingo

Ingo Friepoertner

Ingo is dealing with all the good ideas from the ArangoDB community, customers and industry experts to improve the value provided by the company’s native multi-model approach. In former positions he worked as a product owner and tech consultant, building custom software solutions for large companies in various industries. Ingo holds a diploma in business informatics from FHDW University of Applied Sciences.

Leave a Comment





Get the latest tutorials, blog posts and news: