Table of Contents - ArangoDB › arangodb2 › doc › ArangoDB...Homebrew If you are using...

824
0 1 1.1 1.2 1.3 1.4 1.5 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.6.10 1.6.11 1.6.12 1.7 2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 3 3.1 3.2 3.3 3.3.1 3.3.2 3.3.3 3.4 4 5 5.1 5.2 Table of Contents Introduction Installing Linux M ac OS X Windows ARM Compiling Upgrading Incompatible changes in 2.8 Upgrading to 2.8 Incompatible changes in 2.7 Incompatible changes in 2.6 Upgrading to 2.6 Incompatible changes in 2.5 Upgrading to 2.5 Incompatible changes in 2.4 Upgrading to 2.4 Incompatible changes in 2.3 Upgrading to 2.3 Upgrading to 2.2 Cluster setup Whats New Whats New in 2.7 Whats New in 2.6 Whats New in 2.5 Whats New in 2.4 Whats New in 2.3 Whats New in 2.2 Whats New in 2.1 First Steps Getting Familiar The ArangoDB Server The ArangoDB Shell Shell Output Configuration Details Collections ArangoDB Web Interface Creating and Dropping Databases Working with Databases Notes about Databases ArangoDB 2.8.9 Documentation 1

Transcript of Table of Contents - ArangoDB › arangodb2 › doc › ArangoDB...Homebrew If you are using...

  • 0

    1

    1.1

    1.2

    1.3

    1.4

    1.5

    1.6

    1.6.1

    1.6.2

    1.6.3

    1.6.4

    1.6.5

    1.6.6

    1.6.7

    1.6.8

    1.6.9

    1.6.10

    1.6.11

    1.6.12

    1.7

    2

    2.1

    2.2

    2.3

    2.4

    2.5

    2.6

    2.7

    3

    3.1

    3.2

    3.3

    3.3.1

    3.3.2

    3.3.3

    3.4

    4

    5

    5.1

    5.2

    TableofContentsIntroduction

    Installing

    Linux

    MacOSX

    Windows

    ARM

    Compiling

    Upgrading

    Incompatiblechangesin2.8

    Upgradingto2.8

    Incompatiblechangesin2.7

    Incompatiblechangesin2.6

    Upgradingto2.6

    Incompatiblechangesin2.5

    Upgradingto2.5

    Incompatiblechangesin2.4

    Upgradingto2.4

    Incompatiblechangesin2.3

    Upgradingto2.3

    Upgradingto2.2

    Clustersetup

    WhatsNew

    WhatsNewin2.7

    WhatsNewin2.6

    WhatsNewin2.5

    WhatsNewin2.4

    WhatsNewin2.3

    WhatsNewin2.2

    WhatsNewin2.1

    FirstSteps

    GettingFamiliar

    TheArangoDBServer

    TheArangoDBShell

    ShellOutput

    Configuration

    Details

    Collections

    ArangoDBWebInterface

    CreatingandDroppingDatabases

    WorkingwithDatabases

    NotesaboutDatabases

    ArangoDB2.8.9Documentation

    1

  • 6

    6.1

    6.2

    7

    7.1

    7.2

    7.3

    8

    8.1

    8.2

    8.3

    8.4

    8.4.1

    8.4.2

    8.4.3

    8.4.4

    8.4.5

    9

    9.1

    9.2

    9.3

    9.4

    9.5

    10

    10.1

    10.2

    10.3

    10.4

    10.5

    11

    11.1

    11.2

    11.3

    11.4

    11.5

    11.6

    11.6.1

    11.6.2

    11.6.3

    11.6.4

    11.6.5

    11.6.6

    11.6.7

    11.6.8

    CreatingandDroppingCollections

    CollectionMethods

    DatabaseMethods

    WorkingwithDocuments

    AddressandETag

    CollectionMethods

    DatabaseMethods

    Indexing

    IndexBasics

    WhichIndextousewhen

    HowArangoDBusesindexes

    WorkingwithIndexes

    HashIndexes

    Skiplists

    FulltextIndexes

    GeoIndexes

    CapConstraint

    SimpleQueries

    SequentialAccess

    Pagination

    ModificationQueries

    GeoQueries

    FulltextQueries

    Transactions

    Transactioninvocation

    Passingparameters

    Lockingandisolation

    Durability

    Limitations

    AQL

    HowtoinvokeAQL

    Datamodificationqueries

    TheAQLqueryoptimizer

    TheAQLqueryresultcache

    LanguageBasics

    Functions

    Typecast

    String

    Numeric

    Date

    Array

    Object/Document

    Geo

    Fulltext

    ArangoDB2.8.9Documentation

    2

  • 11.6.9

    11.7

    11.8

    11.9

    11.10

    11.10.1

    11.10.2

    11.10.3

    11.11

    11.12

    11.12.1

    11.12.2

    11.13

    11.13.1

    11.13.2

    11.13.3

    11.13.4

    11.13.5

    11.13.6

    12

    12.1

    12.1.1

    12.1.2

    12.1.3

    12.2

    12.2.1

    12.2.2

    12.3

    13

    13.1

    13.2

    13.2.1

    13.2.2

    13.2.3

    13.2.4

    13.2.5

    13.3

    13.3.1

    13.3.2

    13.3.3

    13.3.4

    13.3.5

    13.3.6

    13.3.7

    Miscellaneous

    QueryResults

    Operators

    HighlevelOperations

    Graphs

    Traversal

    NamedOperations

    Other

    AdvancedFeatures

    ExtendingAQL

    Conventions

    RegisteringFunctions

    AQLExamples

    Collectionbasedqueries

    Data-modificationqueries

    Projectionsandfilters

    Joins

    Grouping

    Traversals

    Graphs

    GeneralGraphs

    GraphManagement

    GraphFunctions

    FluentQueryInterface

    Traversals

    UsingTraversalObjects

    ExampleData

    WorkingwithEdges

    Foxx

    Inanutshell

    Install

    Github

    Store

    Local

    Remote

    Generate

    Development

    Dev-Mode

    Debugging

    SourceFiles

    Controller

    Scripts

    Model

    Repository

    ArangoDB2.8.9Documentation

    3

  • 13.3.8

    13.3.9

    13.3.10

    13.3.11

    13.3.12

    13.3.13

    13.3.14

    13.4

    13.4.1

    13.4.2

    13.4.3

    13.5

    13.5.1

    13.5.2

    14

    14.1

    14.2

    14.3

    15

    15.1

    15.2

    15.3

    15.4

    15.5

    16

    16.1

    16.2

    16.3

    16.4

    17

    17.1

    17.2

    17.3

    17.4

    17.5

    17.6

    17.7

    17.8

    18

    18.1

    18.2

    18.2.1

    18.2.2

    18.2.3

    Queries

    Sessions

    BackgroundTasks

    ConsoleAPI

    Metainformation

    Exports

    Documentation

    Production

    Prod-Mode

    Debugging

    NewVersions

    Cluster

    Install

    Setup&Teardown

    ArangoDB'sActions

    DeliveringHTMLPages

    JsonObjects

    Modifying

    Replication

    Components

    ExampleSetup

    SyncingCollections

    ReplicationLimitations

    ReplicationOverhead

    Sharding

    Howtotryitout

    Implementation

    Authentication

    Firewallsetup

    ServerConfiguration

    Arangodoptions

    Write-aheadlogoptions

    ManagingEndpoints

    Clusteroptions

    Loggingoptions

    Communicationoptions

    Authentication

    EmergencyConsole

    HTTPAPI

    GeneralHTTPHandling

    Databases

    To-Endpoint

    Management

    NotesonDatabases

    ArangoDB2.8.9Documentation

    4

  • 18.3

    18.3.1

    18.3.2

    18.4

    18.4.1

    18.4.2

    18.5

    18.6

    18.6.1

    18.6.2

    18.7

    18.8

    18.9

    18.10

    18.11

    18.11.1

    18.11.2

    18.11.3

    18.12

    18.12.1

    18.12.2

    18.12.3

    18.12.4

    18.12.5

    18.12.6

    18.13

    18.14

    18.14.1

    18.14.2

    18.14.3

    18.15

    18.16

    18.16.1

    18.16.2

    18.16.3

    18.16.4

    18.17

    18.18

    18.19

    18.20

    18.21

    18.22

    18.23

    19

    Documents

    AddressandETag

    Workingwith

    Edges

    AddressandETag

    WorkingwithEdges

    Exportingdata

    AQLQueryCursors

    QueryResults

    AccessingCursors

    AQLQueries

    AQLQueryCache

    AQLUserFunctionsManagement

    SimpleQueries

    Collections

    Creating

    GettingInformation

    Modifying

    Indexes

    WorkingwithIndexes

    CapConstraints

    Hash

    Skiplist

    Geo

    Fulltext

    Transactions

    GeneralGraph

    Management

    Vertices

    Edges

    Traversals

    Replication

    ReplicationDump

    ReplicationLogger

    ReplicationApplier

    OtherReplicationCommands

    Tasks

    Monitoring

    UserManagement

    AsyncResult

    Endpoints

    Sharding

    Miscellaneousfunctions

    BulkImport/Export

    ArangoDB2.8.9Documentation

    5

  • 19.1

    19.2

    19.3

    19.4

    19.5

    19.6

    20

    20.1

    20.2

    20.3

    20.4

    20.5

    20.6

    20.7

    20.8

    20.9

    20.10

    21

    22

    22.1

    22.2

    22.3

    22.4

    23

    23.1

    23.2

    23.3

    23.4

    24

    25

    JSONDocumentsHTTP-API

    Headers&ValuesHTTP-API

    BatchRequestsHTTP-API

    Arangoimp

    Arangodump

    Arangorestore

    JavaScriptModules

    "console"

    "fs"

    "process"

    "request"

    "actions"

    "queries"

    "planner"

    Write-aheadlog

    TaskManagement

    UsingjsUnity

    AdministratingArangoDB

    Advanced

    Arangob

    Write-aheadlog

    ServerInternals

    DatafileDebugger

    NamingConventions

    DatabaseNames

    CollectionNames

    DocumentKeys

    AttributeNames

    Errorcodesandmeanings

    Glossary

    ArangoDB2.8.9Documentation

    6

  • ArangoDBv2.8.9DocumentationWelcometotheArangoDBdocumentation!

    ThedocumentationintroducesArangoDBforyouasauser,developerandadministratoranddescribesallofitsfunctionsindetail.

    ArangoDBisamulti-model,open-sourcedatabasewithflexibledatamodelsfordocuments,graphs,andkey-values.BuildhighperformanceapplicationsusingaconvenientSQL-likequerylanguageorJavaScriptextensions.UseACIDtransactionsifyourequirethem.Scalehorizontallyandverticallywithafewmouseclicks.

    Keyfeaturesinclude:

    Schema-freeschemataletyoucombinethespaceefficiencyofMySQLwiththeperformancepowerofNoSQLUseArangoDBasanapplicationserverandfuseyourapplicationanddatabasetogetherformaximalthroughputJavaScriptforall:nolanguagezoo,youcanuseonelanguagefromyourbrowsertoyourback-endArangoDBismulti-threaded-exploitthepowerofallyourcoresFlexibledatamodeling:modelyourdataascombinationofkey-valuepairs,documentsorgraphs-perfectforsocialrelationsFreeindexchoice:usethecorrectindexforyourproblem,beitaskiplistorafulltextsearchConfigurabledurability:lettheapplicationdecideifitneedsmoredurabilityormoreperformanceNo-nonsensestorage:ArangoDBusesallofthepowerofmodernstoragehardware,likeSSDandlargecachesPowerfulquerylanguage(AQL)toretrieveandmodifydataTransactions:runqueriesonmultipledocumentsorcollectionswithoptionaltransactionalconsistencyandisolationReplicationandSharding:setupthedatabaseinamaster-slaveconfigurationorspreadbiggerdatasetsacrossmultipleserversItisopensource(ApacheLicense2.0)

    Inthisdocumentationyoucaninformyourselfaboutallthefunctions,featuresandprogramsArangoDBprovidesforyou.Featuresareilustratedwithinteractiveusageexamples;youcancut'n'pastethemintoarangoshtotrythemout.ThehttpREST-APIisdemonstratedwithcut'n'pasterecepiesintendedtobeusedwiththecURL.Driversmayprovidetheirownexamplesbasedonthese.jsbasedexamplestoimproveunderstandeabilityfortheirrespectiveusers.I.e.forthejavadriversomeofthesamplesarere-implemented.

    YoucanalsogotoourcookbookandlookthroughsomerecipestolearnmoreaboutArangoDBspecificproblemsandsolutions.

    Community

    IfyouhavequestionsregardingArangoDB,Foxx,drivers,orthisdocumentationdon'thesitatetocontactuson:

    GithubforissuesandmisbehaviororpullrequestsGooglegroupsfordiscussionsaboutArangoDBingeneralortoannounceyournewFoxxAppStackoverflowforquestionsaboutAQL,usagescenariosetc.

    Pleasedescribe:

    theenvironmentyourunArangoDBintheArangoDBversionyouusewhetheryou'reusingFoxxtheclientyou'reusingwhichpartsoftheDocumentationyou'reworkingwith(link)whatyouexpecttohappenwhatsactuallyhappening

    Wewillrespondassoonaspossible.

    ArangoDB2.8.9Documentation

    7Introduction

    http://curl.haxx.sehttps://github.com/arangodb/arangodb-java-driver#learn-morehttps://docs.arangodb.com/cookbookhttps://github.com/arangodb/arangodb/issueshttps://www.arangodb.com/community/https://groups.google.com/forum/?hl=de#!forum/arangodbhttp://stackoverflow.com/questions/tagged/arangodb

  • InstallingThischapterdescribeshowtoinstallArangoDBundervariousoperationsystems.

    FirstofalldownloadandinstallthecorrespondingRPMorDebianpackageorusehomebrewonMacOSX.Youcanfindpackagesforvariousoperationsystemsatourinstallsection.

    InthischapteryouwillalsolearnhowtocompileArangoDBfromscratch.

    YoualsogethelpifyouwanttoupdateyourArangoDBversiontothenewestone!

    ArangoDB2.8.9Documentation

    8Installing

    https://www.arangodb.com/download

  • LinuxYoucanfindbinarypackagesforvariousLinuxdistributionshere.

    Weprovidepackagesfor:

    CentosDebianFedoraLinux-MintMandrivaOpenSUSERedHatRHELSUSESLEUbuntu

    UsingaPackageManagertoinstallArangoDBFollowtheinstructionsontheinstallpagetouseyourfavoritepackagemanagerforthemajordistributions.AftersettinguptheArangoDBrepositoryyoucaneasilyinstallArangoDBusingyum,aptitude,urpmiorzypper.

    Linux-Mint

    PleaseusethecorrespondingUbuntuorDebianpackages.

    UsingVagrantandChefAChefrecipeisavailablefromjbianquettiat:

    https://github.com/jbianquetti/chef-arangodb

    Usingansible

    AnAnsibleroleisavailablethroughAnsible-Galaxy

    RoleonAnsible-Galaxy:https://galaxy.ansible.com/list#/roles/2344SourceonGithub:https://github.com/stackmagic/ansible-arangodb

    ArangoDB2.8.9Documentation

    9Linux

    http://www.arangodb.com/install/https://www.arangodb.com/installhttp://ansible.comhttps://galaxy.ansible.comhttps://galaxy.ansible.com/list#/roles/2344https://github.com/stackmagic/ansible-arangodb

  • MacOSXThepreferredmethodforinstallingArangoDBunderMacOSXishomebrew.However,incaseyouarenotusinghomebrew,weprovideacommand-lineappwhichcontainsalltheexecutables.

    ThereisalsoaversionavailableintheAppStore,whichcomeswithanicegraphicaluserinterfacetostartandstoptheserver.

    Homebrew

    Ifyouareusinghomebrew,thenyoucaninstalltheArangoDBusingbrewasfollows:

    brewinstallarangodb

    ThiswillinstallthecurrentstableversionofArangoDBandalldependencieswithinyourHomebrewtree.Notethattheserverwillbeinstalledas:

    /usr/local/sbin/arangod

    TheArangoDBshellwillbeinstalledas:

    /usr/local/bin/arangosh

    Ifyouwanttoinstallthelatest(unstable)versionuse:

    brewinstall--HEADarangodb

    YoucanuninstallArangoDBusing:

    brewuninstallarangodb

    However,incaseyoustartedArangoDBusingthelaunchctl,youneedtounloaditbeforeuninstallingtheserver:

    launchctlunload~/Library/LaunchAgents/homebrew.mxcl.arangodb.plist

    ThenremovetheLaunchAgent:

    rm~/Library/LaunchAgents/homebrew.mxcl.arangodb.plist

    Note:IfthelatestArangoDBVersionisnotshowninhomebrew,youalsoneedtoupdatehomebrew:

    brewupdate

    Knownissues

    Performance-theLLVMdeliveredasofMacOSXElCapitanbuildsslowbinaries.UseGCCinsteadtheCommandlineargumentparsingdoesn'tacceptblanksinfilenames;theCLIversionbelowdoes.

    Apple'sAppStore

    ArangoDBisavailableinApple'sApp-Store.Pleasenote,thatitsometimestakesdaysorweeksuntilthelatestversionsareavailable.

    Command-LineApp

    ArangoDB2.8.9Documentation

    10MacOSX

    http://brew.sh/

  • Incaseyouarenotusinghomebrew,wealsoprovideacommand-lineapp.Youcandownloaditfromhere.

    ChooseMacOSXandgotoGrabbinarypackagesdirectly.ThisallowsyoutoinstalltheapplicationArangoDB-CLIinyourapplicationfolder.

    Startingtheapplicationwillstarttheserverandopenaterminalwindowshowingyouthelog-file.

    ArangoDBserverhasbeenstarted

    Thedatabasedirectoryislocatedat

    '/Applications/ArangoDB-CLI.app/Contents/MacOS/opt/arangodb/var/lib/arangodb'

    Thelogfileislocatedat

    '/Applications/ArangoDB-CLI.app/Contents/MacOS/opt/arangodb/var/log/arangodb/arangod.log'

    Youcanaccesstheserverusingabrowserat'http://127.0.0.1:8529/'

    orstarttheArangoDBshell

    '/Applications/ArangoDB-CLI.app/Contents/MacOS/arangosh'

    Switchingtolog-filenow,killingthiswindowswillNOTstoptheserver.

    2013-10-27T19:42:04Z[23840]INFOArangoDB(version1.4.devel[darwin])isreadyforbusiness.Havefun!

    Notethatitispossibletoinstallboth,thehomebrewversionandthecommand-lineapp.Youshould,however,edittheconfigurationfilesofoneversionandchangetheportused.

    ArangoDB2.8.9Documentation

    11MacOSX

    https://www.arangodb.com/install

  • WindowsThedefaultinstallationdirectoryisc:\ProgramFiles\ArangoDB-1.x.y.Duringtheinstallationprocessyoumaychangethis.InthefollowingdescriptionwewillassumethatArangoDBhasbeeninstalledinthelocation.

    Youhavetobecarefulwhenchoosinganinstallationdirectory.Youneedeitherwritepermissiontothisdirectoryoryouneedtomodifytheconfigfilefortheserverprocess.InthelattercasethedatabasedirectoryandtheFoxxdirectoryhastobewritablebytheuser.

    Installingforasingleuser:Selectadifferentdirectoryduringinstallation.Forexamplec:\Users\\ArangoDBorc:\ArangoDB.

    Installingformultipleusers:Keepthedefaultdirectory.Aftertheinstallationeditthefile\etc\ArangoDB\arangod.conf.Adjustthedirectoryandapp-pathsothatthesepathspointintoyourhomedirectory.

    [database]

    directory=@HOMEDRIVE@\@HOMEPATH@\arangodb\databases

    [javascript]

    app-path=@HOMEDRIVE@\@HOMEPATH@\arangodb\apps

    CreatethedirectoriesforeachuserthatwantstouseArangoDB.

    InstallingasService:Keepthedefaultdirectory.Aftertheinstallationopenacommandlineasadministrator(searchforcmdandrightclickrunasadministrator).

    cmd>arangod--install-service

    INFO:addingservice'ArangoDB-themulti-modeldatabase'(internal'ArangoDB')

    INFO:addedservicewithcommandline'"C:\ProgramFiles(x86)\ArangoDB1.4.4\bin\arangod.exe"--start-service'

    OpentheservicemanagerandstartArangoDB.Inordertoenablelogging

    editthefile"\etc\arangodb\arangod.conf"anduncommentthefile

    option.

    [log]

    file=@ROOTDIR@\var\log\arangodb\arangod.log

    Client,ServerandLock-Files

    PleasenotethatArangoDBconsistsofadatabaseserverandclienttools.Ifyoustarttheserver,itwillplacea(read-only)lockfiletopreventaccidentalaccesstothedata.Theserverwillattempttoremovethislockfilewhenitisstartedtoseeifthelockisstillvalid-thisisincasetheinstallationdidnotproceedcorrectlyoriftheserverterminatedunexpectedly.

    Starting

    TostartanArangoDBserverinstancewithnetworkingenabled,usetheexecutablearangod.exelocatedin\bin.Thiswillusetheconfigurationfilearangod.conflocatedin\etc\arangodb,whichyoucanadjusttoyourneedsandusethedatadirectory\var\lib\arangodb.Thisistheplacewhereallyourdata(databasesandcollections)willbestoredbydefault.

    Pleasechecktheoutputofthearangod.exeexecutablebeforegoingon.Iftheserverstartedsuccessfully,youshouldseealineArangoDBisreadyforbusiness.Havefun!attheendofitsoutput.

    Wenowwishtocheckthattheinstallationisworkingcorrectlyandtodothiswewillbeusingtheadministrationwebinterface.Executearangod.exeifyouhavenotalreadydoneso,thenopenupyourwebbrowserandpointittothepage:

    http://127.0.0.1:8529/

    Tocheckifyourinstallationwassuccessful,clicktheCollectiontabandopentheconfiguration.SelecttheSystemtype.Iftheinstallationwassuccessful,thenthepageshoulddisplayafewsystemcollections.

    Trytoaddanewcollectionandthenaddsomedocumentstothisnewcollection.Ifyouhavesucceededincreatinganewcollectionandinsertingoneormoredocuments,thenyourinstallationisworkingcorrectly.

    ArangoDB2.8.9Documentation

    12Windows

  • AdvancedStarting

    Ifyouwanttoprovideourownstartscripts,youcansettheenvironmentvariableARANGODB_CONFIG_PATH.Thisvariableshouldpointtoadirectorycontainingtheconfigurationfiles.

    UsingtheClient

    ToconnecttoanalreadyrunningArangoDBserverinstance,thereisashellarangosh.exelocatedin\bin.Thisstartsashellwhichcanbeused–amongstotherthings–toadministerandqueryalocalorremoteArangoDBserver.

    Notethatarangosh.exedoesNOTstartaseparateserver,itonlystartstheshell.Touseityoumusthaveaserverrunningsomewhere,e.g.byusingthearangod.exeexecutable.

    arangosh.exeusesconfigurationfromthefilearangosh.conflocatedin\etc\arangodb\.Pleaseadjustthistoyourneedsifyouwanttousedifferentconnectionsettingsetc.

    32bit

    IfyouhaveanEXISTINGdatabase,thenpleasenotethatcurrentlya32bitversionofArangoDBisNOTcompatiblewitha64bitversion.Thismeansthatifyouhaveadatabasecreatedwitha32bitversionofArangoDBitmaybecomecorruptedifyouexecutea64bitversionofArangoDBagainstthesamedatabase,andviceversa.

    Upgrading

    ToupgradeanEXISTINGdatabasecreatedwithapreviousversionofArangoDB,pleaseexecutetheserverarangod.exewiththeoption--upgrade.OtherwisestartingArangoDBmayfailwitherrors.

    Notethatthereisnoharminrunningtheupgrade.Soyoushouldrunthisbatchfileifyouareunsureofthedatabaseversionyouareusing.

    Youshouldalwayschecktheoutputforerrorstoseeiftheupgradewascompletedsuccessfully.

    Uninstalling

    TouninstalltheArangoserverapplicationyoucanusethewindowscontrolpanel(asyouwouldnormallyuninstallanapplication).Notehowever,thatanydatafilescreatedbytheArangoserverwillremainaswellasthedirectory.Tocompletetheuninstallationprocess,removethedatafilesandthedirectorymanually.

    LimitationsforCygwin

    PleasenotesomeimportantlimitationswhenrunningArangoDBunderCygwin:StartingArangoDBcanbestartedfromoutofaCygwinterminal,butpressingCTRL-Cwillforcefullykilltheserverprocesswithoutgivingitachancetohandlethekillsignal.Inthiscase,aregularservershutdownisnotpossible,whichmayleaveafileLOCKaroundintheserver'sdatadirectory.ThisfileneedstoberemovedmanuallytomakeArangoDBstartagain.Additionally,asArangoDBdoesnothaveachancetohandlethekillsignal,theservercannotforcefullyflushanydatatodiskonshutdown,leadingtopotentialdataloss.WhenstartingArangoDBfromaCygwinterminalitmightalsohappenthatnoerrorsareprintedintheterminaloutput.StartingArangoDBfromanMS-DOScommandpromptdoesnotimposetheselimitationsandisthusthepreferredmethod.

    PleasenotethatArangoDBusesUTF-8asitsinternalencodingandthatthesystemconsolemustsupportaUTF-8codepage(65001)andfont.ItmaybenecessarytomanuallyswitchtheconsolefonttoafontthatsupportsUTF-8.

    ArangoDB2.8.9Documentation

    13Windows

  • ARMTheArangoDBpackagesforARMrequirethekerneltoallowunalignedmemoryaccess.Howthekernelhandlesunalignedmemoryaccessisconfigurableatruntimebycheckingandadjustingthecontents/proc/cpu/alignment.

    InordertooperateonARM,ArangoDBrequiresthebit1tobeset.Thiswillmakethekerneltrapandadjustunalignedmemoryaccesses.Ifthisbitisnotset,thekernelmaysendaSIGBUSsignaltoArangoDBandterminateit.

    Tosetbit1in/proc/cpu/alignmentusethefollowingcommandasaprivilegeduser(e.g.root):

    echo"2">/proc/cpu/alignment

    NotethatthissettingaffectsalluserprocessesandnotjustArangoDB.Settingthealignmentwiththeabovecommandwillalsonotmakethesettingpermanent,soitwillbelostafterarestartofthesystem.Inordertomakethesettingpermanent,itshouldbeexecutedduringsystemstartuporbeforestartingarangod.

    TheArangoDBstart/stopscriptsdonotadjustthealignmentsetting,butrelyontheenvironmenttohavethecorrectalignmentsettingalready.Thereasonforthisisthatthealignmentsettingsalsoaffectallotheruserprocesses(whichArangoDBisnotawareof)andthusmayhaveside-effectsoutsideofArangoDB.Itisthereforemorereasonabletohavethesystemadministratorcarryoutthechanges.

    Ifthealignmentsettingsarenotcorrect,ArangoDBwillloganerroratstartupandabort.

    ArangoDB2.8.9Documentation

    14ARM

  • CompilingArangoDBfromscratchThefollowingsectionsdescribehowtocompileandbuildtheArangoDBfromscratch.ArangoDBwillcompileonmostLinuxandMacOSXsystems.WeassumethatyouusetheGNUC/C++compilerorclang/clang++tocompilethesource.ArangoDBhasbeentestedwiththeGNUC/C++compilerandclang/clang++,butshouldbeabletocompilewithanyPosix-compliant,C++11-enabledcompiler.PleaseletusknowwhetheryousuccessfullycompileditwithanotherC/C++compiler.

    Bydefault,cloningthegithubrepositorywillcheckoutdevel.ThisversioncontainsthedevelopmentversionoftheArangoDB.UsethisbranchifyouwanttomakechangestotheArangoDBsource.

    DevelVersion

    Note:aseparateblogarticleisavailablethatdescribeshowtocompileArangoDBfromsourceonUbuntu.

    BasicSystemRequirements

    Verifythatyoursystemcontains

    theGNUC/C++compilers"gcc"and"g++"andthestandardC/C++libraries,withsupportforC++11.Youwillneedversiongcc4.9.0orhigher.For"clang"and"clang++",youwillneedatleastversion3.6.theGNUautotools(autoconf,automake)GNUmaketheGNUscannergeneratorFLEX,atleastversion2.3.35theGNUparsergeneratorBISON,atleastversion2.4Python,version2or3theOpenSSLlibrary,version1.0.1gorhigher(developmentpackage)theGNUreadlinelibrary(developmentpackage)Go,atleastversion1.4.1

    MostLinuxsystemsalreadysupplyRPMsorDPKGsforthesepackages.Somedistributions,forexampleUbuntu12.04orCentos5,provideonlyveryout-datedversionsofcompilers,FLEX,BISON,and/ortheV8engine.Inthatcaseyouneedtocompilenewerversionsoftheprogramsand/orlibraries.

    Whencompilingwithspecialconfigureoptions,youmayneedthefollowingextralibraries:

    theBoosttestframeworklibrary(onlywhenusingconfigureoption--enable-maintainer-mode)

    DownloadtheSource

    Downloadthelatestsourceusinggit:

    unix>gitclonegit://github.com/arangodb/arangodb.git

    Thiswillautomaticallyclonethedevelbranch.

    Note:ifyouonlyplantocompileArangoDBlocallyanddonotwanttomodifyorpushanychanges,youcanspeedupcloningsubstantiallybyusingthe--single-branchand--depthparametersfortheclonecommandasfollows:

    unix>gitclone--single-branch--depth1git://github.com/arangodb/arangodb.git

    Setup

    SwitchintotheArangoDBdirectory

    unix>cdArangoDB

    Inordertogeneratetheconfigurescript,execute

    ArangoDB2.8.9Documentation

    15Compiling

    http://jsteemann.github.io/blog/2014/10/16/how-to-compile-arangodb-from-source/

  • unix>makesetup

    Thiswillcallaclocal,autoheader,automake,andautoconfinthecorrectorder.

    Configure

    Inordertoconfigurethebuildenvironmentpleaseexecute

    unix>./configure

    tosetupthemakefiles.Thiswillcheckthevarioussystemcharacteristicsandinstalledlibraries.

    Pleasenotethatitmayberequiredtosetthe--hostand--targetvariableswhenrunningtheconfigurecommand.Forexample,ifyoucompileonMacOS,youshouldaddthefollowingoptionstotheconfigurecommand:

    --host=x86_64-apple-darwin--target=x86_64-apple-darwin

    Thehostandtargetvaluesforotherarchitecturesvary.

    IfyoualsoplantomakechangestothesourcecodeofArangoDB,addthefollowingoptiontotheconfigurecommand:--enable-maintainer-mode.Usingthisoption,youcanmakechangestothelexerandparserfilesandsomeothersourcefilesthatwillgenerateotherfiles.EnablingthisoptionwilladdextradependenciestoBISON,FLEX,andPYTHON.Theseexternaltoolsthenneedtobeavailableinthecorrectversionsonyoursystem.

    Thefollowingconfigurationoptionsexist:

    --enable-relative

    Thiswillmakerelativepathsbeusedinthecompiledbinariesandscripts.ItallowstorunArangoDBfromthecompiledirectorydirectly,withouttheneedforamakeinstallcommandandspecifyingmuchconfigurationparameters.Whenused,youcanstartArangoDBusingthiscommand:

    bin/arangod/tmp/database-dir

    ArangoDBwillthenautomaticallyusetheconfigurationfromfileetc/relative/arangod.conf.

    --enable-all-in-one-etcd

    ThistellsthebuildsystemtousethebundledversionofETCD.Thisisthedefaultandrecommended.

    --enable-internal-go

    ThistellsthebuildsystemtouseGobinarieslocatedinthe3rdPartydirectory.NotethatArangoDBdoesnotshipwithGobinaries,andthattheGobinariesmustbecopiedintothisdirectorymanually.

    --enable-maintainer-mode

    ThistellsthebuildsystemtouseBISONandFLEXtoregeneratetheparserandscannerfiles.Ifdisabled,thesuppliedfileswillbeusedsoyoucannotmakechangestotheparserandscannerfiles.YouneedatleastBISON2.4.1andFLEX2.5.35.Thisoptionalsoallowsyoutomakechangestotheerrormessagesfile,whichisconvertedtojsandCheaderfilesusingPython.YouwillneedPython2or3forthis.Furthermore,thisoptionenablesadditionaltestcasestobeexecutedinamakeunittestsrun.YoualsoneedtoinstalltheBoosttestframeworkforthis.

    Additionally,turningonthemaintainermodewillturnonalotofassertionsinthecode.

    --enable-failure-tests

    Thisoptionactivatesadditionalcodeintheserverthatintentionallymakestheservercrashormisbehave(e.g.bypretendingthesystemranoutofmemory).Thisoptionisusefulforwritingtests.

    --enable-v8-debug

    BuildsadebugversionoftheV8library.ThisisusefulonlywhenworkingontheV8integrationinsideArangoDB.

    --enable-tcmalloc

    ArangoDB2.8.9Documentation

    16Compiling

  • Linksarangodandtheclienttoolsagainstthetcmalloclibraryinstalledonthesystem.Notethatwhenthisoptionisset,atcmalloclibrarymustbepresentandexposedunderthenamelibtcmalloc,libtcmalloc_minimalorlibtcmalloc_debug.

    CompilingGo

    UsersF21andduralogtoldusthatsomesystemsdon'tprovideanupdate-to-dateversionofgo.ThisseemstobethecaseforatleastUbuntu12and13.Toinstallgoonthesesystem,youmayfollowtheinstructionsprovidedhere.Forothersystems,youmayfollowtheinstructionshere.

    TomakeArangoDBuseaspecificversionofgo,youmaycopythegobinariesintothe3rdParty/go-32or3rdParty/go-64directoriesofArangoDB(dependingonyourarchitecture),andthentellArangoDBtousethisspecificgoversionbyusingthe--enable-internal-goconfigureoption.

    UserduralogprovidedsomethefollowingscripttopullthelatestreleaseversionofgointotheArangoDBsourcedirectoryandbuildit:

    cdArangoDB

    hgclone-ureleasehttps://code.google.com/p/go3rdParty/go-64&&\

    cd3rdParty/go-64/src&&\

    ./all.bash

    #nowthatgoisinstalled,runyourconfigurewith--enable-internal-go

    ./configure--enable-internal-go

    Compile

    Compiletheprograms(server,client,utilities)byexecuting

    make

    ThiswillcompileArangoDBandcreateabinaryoftheserverin

    ./bin/arangod

    Test

    Createanemptydirectory

    unix>mkdir/tmp/database-dir

    Checkthebinarybystartingitusingthecommandline.

    unix>./bin/arangod-cetc/relative/arangod.conf--server.endpointtcp://127.0.0.1:8529/tmp/database-dir

    ThiswillstartuptheArangoDBandlistenforHTTPrequestsonport8529boundtoIPaddress127.0.0.1.Youshouldseethestartupmessagessimilartothefollowing:

    2013-10-14T12:47:29Z[29266]INFOArangoDBxxx...

    2013-10-14T12:47:29Z[29266]INFOusingendpoint'tcp://127.0.0.1.8529'fornon-encryptedrequests

    2013-10-14T12:47:30Z[29266]INFOAuthenticationisturnedoff

    2013-10-14T12:47:30Z[29266]INFOArangoDB(versionxxx)isreadyforbusiness.Havefun!

    Ifitfailswithamessageaboutthedatabasedirectory,pleasemakesurethedatabasedirectoryyouspecifiedexistsandcanbewritteninto.

    UseyourfavoritebrowsertoaccesstheURL

    http://127.0.0.1:8529/_api/version

    ThisshouldproduceaJSONobjectlike

    ArangoDB2.8.9Documentation

    17Compiling

    http://blog.labix.org/2013/06/15/in-flight-deb-packages-of-gohttp://golang.org/doc/install

  • {"server":"arango","version":"..."}

    asresult.

    Re-buildingArangoDBafteranupdate

    Tostayup-to-datewithchangesmadeinthemainArangoDBrepository,youwillneedtopullthechangesfromitandre-runmake.

    Normally,thiswillbeassimpleasfollows:

    unix>gitpull

    unix>make

    FromtimetotimetherewillbebiggerstructuralchangesinArangoDB,whichmayrendertheoldMakefilesinvalid.Shouldthisbethecaseandmakecomplainsaboutmissingfilesetc.,thefollowingcommandsshouldfixit:

    unix>rm-rflib/*/.depsarangod/*/.depsarangosh/*/.depsMakefile

    unix>makesetup

    unix>./configure

    unix>make

    Inordertoreseteverythingandalsorecompileall3rdpartylibraries,issuethefollowingcommands:

    unix>makesuperclean

    unix>gitcheckout--.

    unix>makesetup

    unix>./configure

    unix>make

    ThiswillcleanupArangoDBandthe3rdpartylibraries,andrebuildeverything.

    Ifyouforgotyourpreviousconfigureoptions,youcanlookthemupwith

    unix>headconfig.log

    beforeissuingmakesuperclean(asmakesupercleanalsoremovesthefileconfig.log).

    Sometimesyoucangetawaywiththelessintrusivecommands.

    Install

    Installeverythingbyexecuting

    makeinstall

    Youmustberoottodothisoratleasthavewritepermissiontothecorrespondingdirectories.

    Theserverwillbydefaultbeinstalledin

    /usr/local/sbin/arangod

    Theconfigurationfilewillbeinstalledin

    /usr/local/etc/arangodb/arangod.conf

    Thedatabasewillbeinstalledin

    /usr/local/var/lib/arangodb

    ArangoDB2.8.9Documentation

    18Compiling

  • TheArangoShellwillbeinstalledin

    /usr/local/bin/arangosh

    Note:Theinstallationdirectorywillbedifferentifyouuseoneoftheprecompiledpackages.Pleasecheckthedefaultlocationsofyouroperatingsystem,e.g./etcand/var/lib.

    WhenupgradingfromapreviousversionofArangoDB,pleasemakesureyouinspectArangoDB'slogfileafteranupgrade.ItmayalsobenecessarytostartArangoDBwiththe--upgradeparameteroncetoperformrequiredupgradeorinitializationtasks.

    ArangoDB2.8.9Documentation

    19Compiling

  • GeneralUpgradeInformation

    Recommendedupgradeprocedure

    ToupgradeanexistingArangoDBdatabasetoanewerversionofArangoDB(e.g.2.2to2.3,or2.3to2.4),thefollowingmethodisrecommended:

    ChecktheCHANGELOGandthelistofincompatiblechangesforAPIorotherchangesinthenewversionofArangoDBandmakesureyourapplicationscandealwiththemStopthe"old"arangodserviceorbinaryCopytheentire"old"datadirectorytoasafeplace(thatis,abackup)InstallthenewversionofArangoDBandstarttheserverwiththe--upgradeoptiononce.ThismightwritetothelogfileofArangoDB,soyoumaywanttocheckthelogsforanyissuesbeforegoingon.Startthe"new"arangodserviceorbinaryregularlyandcheckthelogsforanyissues.Whenyou'reconfidenteverythingwentwell,youmaywanttocheckthedatabasedirectoryforanyfileswiththeending.old.ThesefilesarecreatedbyArangoDBduringupgradesandcanbesafelyremovedmanuallylater.

    Ifanythinggoeswrongduringorshortlyaftertheupgrade:

    Stopthe"new"arangodserviceorbinaryReverttothe"old"arangodbinaryandrestorethe"old"datadirectoryStartthe"old"versionagain

    ItisnotsupportedtousedatafilescreatedormodifiedbyanewerversionofArangoDBwithanolderArangoDBversion.Forexample,itisunsupportedandislikelytocauseproblemswhenusing2.3datafileswithanArangoDB2.2instance.

    ArangoDB2.8.9Documentation

    20Upgrading

  • IncompatiblechangesinArangoDB2.8ItisrecommendedtocheckthefollowinglistofincompatiblechangesbeforeupgradingtoArangoDB2.8,andadjustanyclientprogramsifnecessary.

    AQL

    Keywordsadded

    ThefollowingAQLkeywordswereaddedinArangoDB2.8:

    GRAPH

    OUTBOUND

    INBOUND

    ANY

    ALL

    NONE

    AGGREGATE

    Usageofthesekeywordsforcollectionnames,variablenamesorattributenamesinAQLquerieswillnotbepossiblewithoutquoting.Forexample,thefollowingAQLquerywillstillworkasitusesaquotedcollectionnameandaquotedattributename:

    FORdocIN`OUTBOUND`

    RETURNdoc.`any`

    Changedbehavior

    TheAQLfunctionsNEARandWITHINnowhavestrictervalidationsfortheirinputparameterslimit,radiusanddistance.Theymaynowthrowexceptionswheninvalidparametersarepassedthatmayhavenotledtoexceptionsinpreviousversions.

    Additionally,theexpansion([*])operatorinAQLhaschangeditsbehaviorwhenhandlingnon-arrayvalues:

    InArangoDB2.8,callingtheexpansionoperatoronanon-arrayvaluewillalwaysreturnanemptyarray.PreviousversionsofArangoDBexpandednon-arrayvaluesbycallingtheTO_ARRAY()functionforthevalue,whichforexamplereturnedanarraywithasinglevalueforboolean,numericandstringinputvalues,andanarraywiththeobject'svaluesforanobjectinputvalue.Thisbehaviorwasinconsistentwithhowtheexpansionoperatorworksforthearrayindexesin2.8,sothebehaviorisnowunified:

    iftheleft-handsideoperandof[*]isanarray,thearraywillbereturnedasiswhencalling[*]onitiftheleft-handsideoperandof[*]isnotanarray,anemptyarraywillbereturnedby[*]

    AQLqueriesthatrelyontheoldbehaviorcanbechangedbyeithercallingTO_ARRAYexplicitlyorbyusingthe[*]atthecorrectposition.

    Thefollowingexamplequerywillchangeitsresultin2.8comparedto2.7:

    LETvalues="foo"RETURNvalues[*]

    In2.7thequeryhasreturnedthearray["foo"],butin2.8itwillreturnanemptyarray[].Tomakeitreturnthearray["foo"]again,anexplicitTO_ARRAYfunctioncallisneededin2.8(whichinthiscaseallowstheremovalofthe[*]operatoraltogether).Thisalsoworksin2.7:

    LETvalues="foo"RETURNTO_ARRAY(values)

    Anotherexample:

    LETvalues=[{name:"foo"},{name:"bar"}]

    RETURNvalues[*].name[*]

    ArangoDB2.8.9Documentation

    21Incompatiblechangesin2.8

  • Theabovereturned[["foo"],["bar"]]in2.7.In2.8itwillreturn[[],[]],becausethevalueofname`isnotanarray.Tochangetheresultstothe2.7style,thequerycanbechangedto

    LETvalues=[{name:"foo"},{name:"bar"}]

    RETURNvalues[*RETURNTO_ARRAY(CURRENT.name)]

    Theabovealsoworksin2.7.Thefollowingtypesofquerieswon'tchange:

    LETvalues=[1,2,3]RETURNvalues[*]

    LETvalues=[{name:"foo"},{name:"bar"}]RETURNvalues[*].name

    LETvalues=[{names:["foo","bar"]},{names:["baz"]}]RETURNvalues[*].names[*]

    LETvalues=[{names:["foo","bar"]},{names:["baz"]}]RETURNvalues[*].names[**]

    Deadlockhandling

    Clientapplicationsshouldbepreparedtohandleerror29(deadlockdetected)thatArangoDBmaynowthrowwhenitdetectsadeadlockacrossmultipletransactions.Whenaclientapplicationreceiveserror29,itshouldretrytheoperationthatfailed.

    TheerrorcanonlyoccurforAQLqueriesorusertransactionsthatinvolvemorethanasinglecollection.

    Optimizer

    TheAQLexecutionnodetypeIndexRangeNodewasreplacedwithanewmorecapableexecutionnodetypeIndexNode.ThatmeansinexecutionplanexplainoutputtherewillbenomoreIndexRangeNodesbutonlyIndexNode.Thisaffectsexplainoutputthatcanberetrievedviarequire("org/arangodb/aql/explainer").explain(query),db._explain(query),andtheHTTPqueryexplainAPI.

    TheoptimizerrulethatmakesAQLqueriesactuallyuseindexeswasalsorenamedfromuse-index-rangetouse-indexes.Againthisaffectsexplainoutputthatcanberetrievedviarequire("org/arangodb/aql/explainer").explain(query),db._explain(query),andtheHTTPqueryexplainAPI.

    Thequeryoptimizerruleremove-collect-intowasrenamedtoremove-collect-variables.Thisaffectsexplainoutputthatcanberetrievedviarequire("org/arangodb/aql/explainer").explain(query),db._explain(query),andtheHTTPqueryexplainAPI.

    HTTPAPI

    Whenaserver-sideoperationgotcanceledduetoanexplicitclientcancelrequestviaHTTPDELETE/_api/job,previousversionsofArangoDBreturnedanHTTPstatuscodeof408(requesttimeout)fortheresponseofthecanceledoperation.

    TheHTTPreturncode408hascausedproblemswithsomeclientapplications.Somebrowsers(e.g.Chrome)handleda408responsebyresendingtheoriginalrequest,whichistheoppositeofwhatisdesiredwhenajobshouldbecanceled.

    ThereforeArangoDBwillreturnHTTPstatuscode410(gone)forcanceledoperationsfromversion2.8on.

    Foxx

    ModelandRepository

    DuetocompatibilityissuestheModelandRepositorytypesarenolongerimplementedasES2015classes.

    Thepre-2.7"extend"stylesubclassingissupportedagainandwillnotemitanydeprecationwarnings.

    varFoxx=require('org/arangodb/foxx');

    varMyModel=Foxx.Model.extend({

    //...

    schema:{/*...*/}

    });

    Moduleresolution

    ArangoDB2.8.9Documentation

    22Incompatiblechangesin2.8

  • ThebehavioroftheJavaScriptmoduleresolutionusedbytherequirefunctionhasbeenmodifiedtoimprovecompatibilitywithmoduleswrittenforNode.js.

    Specifically

    absolutepaths(e.g./some/absolute/path)arenowalwaysinterpretedasabsolutefilesystempaths,relativetothefilesystemroot

    globalnames(e.g.global/name)arenowfirstintepretedasreferencestomodulesresidinginarelevantnode_modulesfolder,abuilt-inmoduleoramatchingdocumentintheinternal_modulescollection,andonlyresolvedtolocalfilepathsifnoothermatchisfound

    Previouslythetwoformatsweretreatedinterchangeablyandwouldberesolvedtolocalfilepathsfirst,leadingtoproblemswhenlocalfilesusedthesamenamesasothermodules(e.g.alocalfilechai.jswouldcauseproblemswhentryingtoloadthechaimoduleinstalledinnode_modules).

    Formoreinformationseetheblogannouncementofthischangeandtheupgradeguide.

    Moduleorg/arangodb/request

    Themodulenowalwaysreturnsresponsebodies,evenforerrorresponses.Inversionspriorto2.8themodulewouldsilentlydropresponsebodiesiftheresponseheaderindicatedanerror.

    TheoldbehaviorofnotreturningbodiesforerrorresponsescanberestoredbyexplicitlysettingtheoptionreturnBodyOnErrortofalse:

    letresponse=request({

    //...

    returnBodyOnError:false

    });

    Garbagecollection

    TheV8garbagecollectionstrategywasslightlyadjustedsothatiteventuallyhappensinallV8contextsthatholdV8externalobjects(referencestoArangoDBdocumentsandcollections).Thisenablesabettercleanupoftheseresourcesandpreventsotherprocessessuchascompactionbeingstalledwhilewaitingfortheseresourcestobereleased.

    InthiscontextthedefaultvaluefortheJavaScriptgarbagecollectionfrequency(--javascript.gc-frequency)wasalsoincreasedfrom10secondsto15seconds,aslessinternaloperationsinArangoDBarecarriedoutinJavaScript.

    Clienttools

    arangodumpwillnowfailbydefaultwhentryingtodumpedgesthatrefertoalreadydroppedcollections.Thiscanbecircumventedbyspecifyingtheoption--forcetruewheninvokingarangodump

    ArangoDB2.8.9Documentation

    23Incompatiblechangesin2.8

    https://www.arangodb.com/2015/11/foxx-module-resolution-will-change-in-2-8/

  • UpgradingtoArangoDB2.8PleasereadthefollowingsectionsifyouupgradefromapreviousversiontoArangoDB2.8.Pleasebesurethatyouhavecheckedthelistofchangesin2.8beforeupgrading.

    PleasenotefirstthatadatabasedirectoryusedwithArangoDB2.8cannotbeusedwithearlierversions(e.g.ArangoDB2.7)anymore.Upgradingadatabasedirectorycannotbereverted.ThereforepleasemakesuretocreateafullbackupofyourexistingArangoDBinstallationbeforeperforminganupgrade.

    DatabaseDirectoryVersionCheckandUpgrade

    ArangoDBwillperformadatabaseversioncheckatstartup.WhenArangoDB2.8encountersadatabasecreatedwithearlierversionsofArangoDB,itwillrefusetostart.Thisisintentional.

    Theoutputwillthenlooklikethis:

    2015-12-04T17:11:17Z[31432]ERRORIndatabase'_system':Databasedirectoryversion(20702)islowerthancurrentversion(20800).

    2015-12-04T17:11:17Z[31432]ERRORIndatabase'_system':----------------------------------------------------------------------

    2015-12-04T17:11:17Z[31432]ERRORIndatabase'_system':ItseemslikeyouhaveupgradedtheArangoDBbinary.

    2015-12-04T17:11:17Z[31432]ERRORIndatabase'_system':Ifthisiswhatyouwantedtodo,pleaserestartwiththe

    2015-12-04T17:11:17Z[31432]ERRORIndatabase'_system':--upgrade

    2015-12-04T17:11:17Z[31432]ERRORIndatabase'_system':optiontoupgradethedatainthedatabasedirectory.

    2015-12-04T17:11:17Z[31432]ERRORIndatabase'_system':Normallyyoucanusethecontrolscripttoupgradeyourdatabase

    2015-12-04T17:11:17Z[31432]ERRORIndatabase'_system':/etc/init.d/arangodbstop

    2015-12-04T17:11:17Z[31432]ERRORIndatabase'_system':/etc/init.d/arangodbupgrade

    2015-12-04T17:11:17Z[31432]ERRORIndatabase'_system':/etc/init.d/arangodbstart

    2015-12-04T17:11:17Z[31432]ERRORIndatabase'_system':----------------------------------------------------------------------

    2015-12-04T17:11:17Z[31432]FATALDatabase'_system'needsupgrade.Pleasestarttheserverwiththe--upgradeoption

    TomakeArangoDB2.8startwithadatabasedirectorycreatedwithanearlierArangoDBversion,youmayneedtoinvoketheupgradeprocedureonce.ThiscanbedonebyrunningArangoDBfromthecommandlineandsupplyingthe--upgradeoption.

    Note:herethesamedatabaseshouldbespecifiedthatisalsospecifiedwhenarangodisstartedregularly.Pleasedonotrunthe--upgradecommandoneachindividualdatabasesubfolder(nameddatabase-).

    Forexample,ifyouregularlystartyourArangoDBserverwith

    unix>arangodmydatabasefolder

    thenrunning

    unix>arangodmydatabasefolder--upgrade

    willperformtheupgradeforthewholeArangoDBinstance,includingallofitsdatabases.

    Startingwith--upgradewillrunadatabaseversioncheckandperformanynecessarymigrations.Asusual,youshouldcreateabackupofyourdatabasedirectorybeforeperformingtheupgrade.

    Thelastlineoftheoutputshouldlooklikethis:

    2015-12-04T17:12:15Z[31558]INFOdatabaseupgradepassed

    Pleasecheckthefulloutputthe--upgraderun.Upgradingmayproduceerrors,whichneedtobefixedbeforeArangoDBcanbeusedproperly.Ifnoerrorsarepresentortheyhavebeenresolvedmanually,youcanstartArangoDB2.8regularly.

    Upgradingaclusterplannedinthewebinterface

    ArangoDB2.8.9Documentation

    24Upgradingto2.8

  • AclusterofArangoDBinstanceshastobeupgradedaswell.ThisinvolvesupgradingallArangoDBinstancesinthecluster,aswellasrunningtheversioncheckonthewholerunningclusterintheend.

    Wehavetriedtomakethisprocedureaspainlessandconvenientforyou.Weassumethatyouplanned,launchedandadministratedaclusterusingthegraphicalfrontendinyourbrowser.Theupgradeprocedureisthenasfollows:

    1. Firstshutdownyourclusterusingthegraphicalfrontendasusual.

    2. Thenupgradealldispatcherinstancesonallmachinesinyourclusterusingtheversioncheckasdescribedaboveandrestartthem.

    3. Nowopentheclusterdashboardinyourbrowserbypointingittothesamedispatcherthatyouusedtoplanandlaunchtheclusterinthegraphicalfrontend.Inadditiontotheusualbuttons"Relaunch","Editclusterplan"and"Deleteclusterplan"youwillseeanotherbuttonmarked"Upgradeandrelaunchcluster".

    4. Hitthisbutton,yourclusterwillbeupgradedandlaunchedandallisdoneforyoubehindthescenes.Ifallgoeswell,youwillseetheusualclusterdashboardafterafewseconds.Ifthereisanerror,youhavetoinspectthelogfilesofyourclusterArangoDBinstances.Pleaseletusknowifyourunintoproblems.

    ThereisanalternativewayusingtheArangoDBshell.Insteadofsteps3.and4.aboveyoucanlauncharangosh,pointittothedispatcherthatyouhaveusedtoplanandlaunchtheclusterusingtheoption--server.endpoint,andexecute

    arangosh>require("org/arangodb/cluster").Upgrade("root","");

    Thisupgradestheclusterandlaunchesit,exactlyaswiththebuttonaboveinthegraphicalfrontend.Youhavetoreplace"root"withausernameand""withapasswordthatisvalidforauthenticationwiththecluster.

    UpgradingFoxxappsgeneratedbyArangoDB2.7andearlier

    TheimplementationoftherequirefunctionusedtoimportmodulesinArangoDBandFoxxhaschangedinordertoimprovecompatibilitywithNode.jsmodules.

    Givenanapp/servicewiththefollowinglayout:

    manifest.jsoncontrollers/

    todos.jsmodels/

    todo.jsrepositories/

    todos.jsnode_modules/

    models/todo.js

    Thefilecontrollers/todos.jswouldpreviouslycontainthefollowingrequirecalls:

    var_=require('underscore');

    varjoi=require('joi');

    varFoxx=require('org/arangodb/foxx');

    varArangoError=require('org/arangodb').ArangoError;

    varTodos=require('repositories/todos');//

  • var_=require('underscore');

    varjoi=require('joi');

    varFoxx=require('org/arangodb/foxx');

    varArangoError=require('org/arangodb').ArangoError;

    varTodos=require('../repositories/todos');//

  • IncompatiblechangesinArangoDB2.7ItisrecommendedtocheckthefollowinglistofincompatiblechangesbeforeupgradingtoArangoDB2.7,andadjustanyclientprogramsifnecessary.

    AQLchanges

    DISTINCTisnowakeywordinAQL.

    AQLqueriesthatuseDISTINCT(inlower,upperormixedcase)asanidentifier(i.e.asavariable,acollectionnameorafunctionname)willstopworking.Tomakesuchqueriesworkingagain,eachoccurrenceofDISTINCTinanAQLqueryshouldbeenclosedinbackticks.ThiswillturnDISTINCTfromakeywordintoanidentifieragain.

    TheAQLfunctionSKIPLIST()hasbeenremovedinArangoDB2.7.ThisfunctionwasdeprecatedinArangoDB2.6.Itwasaleft-overfromtimeswhenthequeryoptimizerwasn'tabletouseskiplistindexestogetherwithfilters,skipandlimitvalues.Sincethisissuebeenfixedsinceversion2.3,thereisnoAQLreplacementfunctionforSKIPLIST.QueriesthatusetheSKIPLISTfunctioncanbefixedbyusingtheusualcombinationofFOR,FILTERandLIMIT,e.g.

    FORdocIN@@collection

    FILTERdoc.value>=@value

    SORTdoc.valueDESC

    LIMIT1

    RETURNdoc

    Foxxchanges

    Bundlingandcompilation

    TheassetspropertyisnolongersupportedinFoxxmanifestsandisscheduledtoberemovedinafutureversionofArangoDB.Thefilespropertycanstillbeusedtoservestaticassetsbutitisrecommendedtouseseparatetoolingtocompileandbundleyourassets.

    Manifestscripts

    Thepropertiessetupandteardownhavebeenmovedintothescriptspropertymap:

    Before:

    {

    ...

    "setup":"scripts/setup.js",

    "teardown":"scripts/teardown.js"

    }

    After:

    {

    ...

    "scripts":{

    "setup":"scripts/setup.js",

    "teardown":"scripts/teardown.js"

    }

    }

    FoxxQueues

    Function-basedFoxxQueuejobtypesarenolongersupported.Tolearnabouthowyoucanusethenewscript-basedjobtypesfollowtheupdatedrecipeinthecookbook.

    ArangoDB2.8.9Documentation

    27Incompatiblechangesin2.7

    https://docs.arangodb.com/cookbook/FoxxQueues.html

  • FoxxSessions

    ThejwtandtypeoptionshavebeenremovedfromtheactivateSessionsAPI.

    IfyouwanttoreplicatethebehaviorofthejwtoptionyoucanusetheJWTfunctionsinthecryptomodule.AJWT-basedsessionstoragethatdoesn'twritesessionstothedatabaseisavailableasthesessions-jwtappintheFoxxappstore.

    Thesessiontypeisnowinferredfromthepresenceofthecookieorheaderoptions(allowingyoutoenablesupportforboth).Ifyouwanttousethedefaultsettingsforcookieorheaderyoucanpassthevaluetrueinstead.

    ThesessionStorageAppoptionhasbeenremovedinfavorofthesessionStorageoption.

    Before:

    varFoxx=require('org/arangodb/foxx');

    varctrl=newFoxx.Controller(applicationContext);

    ctrl.activateSessions({

    sessionStorageApp:'some-sessions-app',

    type:'cookie'

    });

    After:

    ctrl.activateSessions({

    sessionStorage:applicationContext.dependencies.sessions.sessionStorage,

    cookie:true

    });

    Requestmodule

    Themoduleorg/arangodb/requestusesaninternallibraryfunctionforsendingHTTPrequests.ThislibraryfunctionallyunconditionallysetanHTTPheaderAccept-Encoding:gzipinalloutgoingHTTPrequests,withoutclientcodehavingtosetthisheaderexplicitly.

    Thishasbeenfixedin2.7,soAccept-Encoding:gzipisnotsetautomaticallyanymore.AdditionallytheheaderUser-Agent:ArangoDBisnotsetautomaticallyeither.Ifclientapplicationsrelyontheseheadersbeingsent,theyarefreetoadditwhenconstructingrequestsusingtherequestmodule.

    Theinternal.download()functionisalsoaffectedbythischange.Again,theheadercanbeaddedhereifrequiredbypassingitviaaheaderssub-attributeinthethirdparameter(options)tothisfunction.

    arangodump/backupsThefilenamesindumpscreatedbyarangodumpnowcontainnotonlythenameofthedumpedcollection,butalsoanadditional32-digithashvalue.Thisisdonetopreventoverwritingdumpfilesincase-insensitivefilesystemswhenthereexistmultiplecollectionswiththesamename(butwithdifferentcases).

    Thischangeleadstochangedfilenamesindumpscreatedbyarangodump.Ifanyclientscriptsdependonthefilenamesinthedumpoutputdirectorybeingequaltothecollectionnameplusoneofthesuffixes.structure.jsonand.data.json,theyneedtobeadjusted.

    StartingwithArangoDB2.7,thefilenameswillcontainanunderscoreplusthe32-digitMD5value(representedinhexadecimalnotation)ofthecollectionname.

    Forexample,whenarangodumpdumpsdataoftwocollectionstestandTest,thefilenamesinpreviousversionsofArangoDBwere:

    test.structure.json(definitionsforcollectiontest)test.data.json(dataforcollectiontest)Test.structure.json(definitionsforcollectionTest)Test.data.json(dataforcollectionTest)

    In2.7,thefilenameswillbe:

    test_098f6bcd4621d373cade4e832627b4f6.structure.json(definitionsforcollectiontest)

    ArangoDB2.8.9Documentation

    28Incompatiblechangesin2.7

    https://github.com/arangodb/foxx-sessions-jwt

  • test_098f6bcd4621d373cade4e832627b4f6.data.json(dataforcollectiontest)Test_0cbc6611f5540bd0809a388dc95a615b.structure.json(definitionsforcollectionTest)Test_0cbc6611f5540bd0809a388dc95a615b.data.json(dataforcollectionTest)

    Starting/stopping

    Whenstartingarangod,theserverwillnowdroptheprocessprivilegestothespecifiedvaluesinoptions--server.uidand--server.gidinstantlyafterparsingthestartupoptions.

    Thatmeanswheneither--server.uidor--server.gidareset,theprivilegechangewillhappenearlier.Thismaypreventbindingtheservertoanendpointwithaportnumberlowerthan1024ifthearangodbuserhasnoprivilegesforthat.PreviousversionsofArangoDBchangedtheprivilegeslater,sosomestartupactionswerestillcarriedoutundertheinvokinguser(i.e.likelyrootwhenstartedviainit.dorsystemscripts)andespeciallybindingtolowportnumberswasstillpossiblethere.

    Thedefaultprivilegesforuserarangodbwillnotbesufficientforbindingtoportnumberslowerthan1024.TohaveanArangoDB2.7bindtoaportnumberlowerthan1024,itneedstobestartedwitheitheradifferentprivilegeduser,ortheprivilegesofthearangodbuserhavetoraisedmanuallybeforehand.

    Additionally,LinuxstartupscriptsandsystemdconfigurationforarangodnowwilladjusttheNOFILE(numberofopenfiles)limitsfortheprocess.Thelimitvalueissetto131072(128k)whenArangoDBisstartedviastart/stopcommands.Thegoalofthischangeistopreventarangodfromrunningoutofavailablefiledescriptorsforsocketconnectionsanddatafiles.

    Connectionhandling

    arangodwillnowactuallycloselingeringclientconnectionswhenidleforatleastthedurationspecifiedinthe--server.keep-alive-timeoutstartupoption.

    InpreviousversionsofArangoDB,idleconnectionswerenotclosedbytheserverwhenthetimeoutwasreachedandtheclientwasstillconnected.Nowtheconnectionisproperlyclosedbytheserverincaseoftimeout.Clientapplicationsrelyingontheoldbehaviormaynowneedtoreconnecttotheserverwhentheiridleconnectionstimeoutandgetclosed(note:connectionsbeingidleforalongtimemaybeclosedbytheOSorfirewallsanyway-clientapplicationsshouldbeawareofthatandtrytoreconnect).

    Optionchanges

    Configureoptionsremoved

    Thefollowingoptionsforconfigurehavebeenremovedbecausetheywereunusedorexotic:

    --enable-timings

    --enable-figures

    Startupoptionsadded

    Thefollowingconfigurationoptionshavebeenaddedin2.7:

    --database.query-cache-max-results:setsthemaximumnumberofresultsinAQLqueryresultcacheperdatabase--database.query-cache-mode:setsthemodefortheAQLqueryresultscache.Possiblevaluesareon,offanddemand.Thedefaultvalueisoff

    Miscellaneouschanges

    Simplequeries

    Manysimplequeriesprovideaskip()functionthatcanbeusedtoskipoveracertainnumberofdocumentsintheresult.ThisfunctionallowedspecifyingnegativeoffsetsinpreviousversionsofArangoDB.Specifyinganegativeoffsetledtothequeryresultbeingiteratedinreverseorder,soskippingwasperformedfromthebackoftheresult.Asmostsimplequeriesdonotprovideaguaranteedresultorder,

    ArangoDB2.8.9Documentation

    29Incompatiblechangesin2.7

  • skippingfromthebackofaresultwithunspecificorderseemsaratherexoticusecaseandwasremovedtoincreaseconsistencywith

    AQL,whichalsodoesnotprovidenegativeskipvalues.

    NegativeskipvaluesweredeprecatedinArangoDB2.6.

    TasksAPI

    TheundocumentedfunctionaddJob()hasbeenremovedfromtheorg/arangodb/tasksmoduleinArangoDB2.7.

    RuntimeendpointsmanipulationAPI

    ThefollowingHTTPRESTAPImethodsforruntimemanipulationofserverendpointshavebeenremovedinArangoDB2.7:

    POST/_api/endpoint:todynamicallyaddanendpointwhiletheserverwasrunningDELETE/_api/endpoint:todynamicallyremoveanendpointwhiletheserverwasrunning

    ThischangealsoaffectstheequivalentJavaScriptendpointmanipulationmethodsavailableinFoxx.ThefollowingfunctionshavebeenremovedinArangoDB2.7:

    db._configureEndpoint()

    db._removeEndpoint()

    ArangoDB2.8.9Documentation

    30Incompatiblechangesin2.7

  • IncompatiblechangesinArangoDB2.6ItisrecommendedtocheckthefollowinglistofincompatiblechangesbeforeupgradingtoArangoDB2.6,andadjustanyclientprogramsifnecessary.

    Requirements

    ArangoDB'sbuilt-inwebinterfacenowusescookiesforsessionmanagement.Sessioninformationidsarestoredincookies,soclientsusingthewebinterfacemustacceptcookiesinordertologinanduseit.

    Foxxchanges

    FoxxQueues

    FoxxQueuejobtypedefinitionswerepreviouslybasedonfunctionsandhadtoberegisteredbeforeuse.Duetochangesin2.5thisresultedinproblemswhenrestartingtheserverordefiningjobtypesincorrectly.

    Function-basedjobtypeshavebeendeprecatedin2.6andwillberemovedentirelyin2.7.

    Inordertoconvertexistingfunction-basedjobtypestothenewscript-basedjobtypes,createcustomscriptsinyourFoxxappandreferencethembytheirnameandthemountpointoftheapptheyaredefinedin.OfficialjobtypesfromtheFoxxappstorecanbeupgradedbyupgradingfromthe1.xversiontothe2.xversionofthesameapp.

    Inordertoupgradequeuedjobstothenewjobtypes,youneedtoupdatethetypepropertyoftheaffectedjobsinthedatabase's_jobssystemcollection.Inordertoseethecollectioninthewebinterfaceyouneedtoenablethecollectiontype"System"inthecollectionlistoptions.

    Example:

    Before:"type":"mailer.postmark"

    After:"type":{"name":"mailer","mount":"/my-postmark-mailer"}

    FoxxSessions

    Theoptionsjwtandtypeofthecontrollermethodcontroller.activateSessionshavebeendeprecatedin2.6andwillberemovedentirelyin2.7.

    IfyouwanttousepureJWTsessions,youcanusethesessions-jwtFoxxappfromtheFoxxappstore.

    IfyouwanttouseyourownJWT-basedsessions,youcanusetheJWTfunctionsinthecryptomoduledirectly.

    Insteadofusingthetypeoptionyoucanjustusethecookieandheaderoptionsontheirown,whichbothnowacceptthevaluetruetoenablethemwiththeirdefaultconfigurations.

    TheoptionsessionStorageApphasbeenrenamedtosessionStorageandnowalsoacceptssessionstoragesdirectly.TheoldoptionsessionStorageAppwillberemovedentirelyin2.7.

    Libraries

    ThebundledversionofthejoilibraryusedinFoxxwasupgradedtoversion6.0.8.ThismayaffectFoxxapplicationsthatdependonthelibrary.

    AQLchanges

    AQLLENGTHfunction

    ArangoDB2.8.9Documentation

    31Incompatiblechangesin2.6

  • ThereturnvalueoftheAQLLENGTHfunctionwaschangedifLENGTHisappliedonnullorabooleanvalue:

    LENGTH(null)nowreturns0.InpreviousversionsofArangoDB,thisreturned4.

    LENGTH(false)nowreturns0.InpreviousversionsofArangoDB,thereturnvaluewas5.

    LENGTH(true)nowreturns1.InpreviousversionsofArangoDB,thereturnvaluewas4.

    AQLgraphfunctions

    In2.6thegraphfunctionsdidundergoaperformancelifting.Duringthisprocesswehadtoadopttheresultformatandtheoptionsforsomeofthem.ManygraphfunctionsnowhaveanoptionincludeDatawhichallowstotriggeriftheresultofthisfunctionshouldcontainfullyextracteddocumentsincludeData:trueoronlythe_idvaluesincludeData:false.Inmostusecasesthe_idissufficienttocontinueandtheextractionofdataisanunnecessaryoperation.TheAQLfunctionssupportingthisadditionaloptionare:

    SHORTEST_PATHNEIGHBORSGRAPH_SHORTEST_PATHGRAPH_NEIGHBORSGRAPH_EDGES

    FurthermoretheresultSHORTEST_PATHhaschanged.Theoldformatreturnedalistofallverticesonthepath.Optionallyitcouldincludeeachsub-pathforthesevertices.Allofthedocumentswerefullyextracted.Example:

    ArangoDB2.8.9Documentation

    32Incompatiblechangesin2.6

  • [

    {

    vertex:{

    _id:"vertex/1",

    _key:"1",

    _rev:"1234"

    name:"Alice"

    },

    path:{

    vertices:[

    {

    _id:"vertex/1",

    _key:"1",

    _rev:"1234"

    name:"Alice"

    }

    ],

    edges:[]

    }

    },

    {

    vertex:{

    _id:"vertex/2",

    _key:"2",

    _rev:"5678"

    name:"Bob"

    },

    path:{

    vertices:[

    {

    _id:"vertex/1",

    _key:"1",

    _rev:"1234"

    name:"Alice"

    },{

    _id:"vertex/2",

    _key:"2",

    _rev:"5678"

    name:"Bob"

    }

    ],

    edges:[

    {

    _id:"edge/1",

    _key:"1",

    _rev:"9876",

    type:"loves"

    }

    ]

    }

    }

    ]

    Thenewversionismorecompact.EachSHORTEST_PATHwillonlyreturnonedocumenthavingtheattributesvertices,edges,distance.Thedistanceiscomputedtakingintoaccountthegivenweight.OptionallythedocumentscanbeextractedwithincludeData:trueExample:

    {

    vertices:[

    "vertex/1",

    "vertex/2"

    ],

    edges:[

    "edge/1"

    ],

    distance:1

    }

    ThenextfunctionthatreturnsadifferentformatisNEIGHBORS.Since2.5itreturnedanobjectwithedgeandvertexforeachconnectededge.Example:

    ArangoDB2.8.9Documentation

    33Incompatiblechangesin2.6

  • [

    {

    vertex:{

    _id:"vertex/2",

    _key:"2",

    _rev:"5678"

    name:"Bob"

    },

    edge:{

    _id:"edge/1",

    _key:"1",

    _rev:"9876",

    type:"loves"

    }

    }

    ]

    With2.6itwillonlyreturnthevertexdirectly,againusingincludeData:true.Bydefaultitwillreturnadistinctsetofneighbors,usingtheoptiondistinct:falsewillincludethesamevertexforeachedgepointingtoit.

    Example:

    [

    "vertex/2"

    ]

    FunctionandAPIchanges

    Graphmeasurementsfunctions

    AllgraphmeasurementsfunctionsinJavaScriptmodulegeneral-graphthatcalculatedasinglefigurepreviouslyreturnedanarraycontainingjustthefigure.Nowthesefunctionswillreturnthefiguredirectlyandnotputitinsideanarray.

    Theaffectedfunctionsare:

    graph._absoluteEccentricity

    graph._eccentricity

    graph._absoluteCloseness

    graph._closeness

    graph._absoluteBetweenness

    graph._betweenness

    graph._radius

    graph._diameter

    Clientprogramscallingthesefunctionsshouldbeadjustedsotheyprocessthescalarvaluereturnedbythefunctioninsteadofthepreviousarrayvalue.

    CursorAPI

    AbatchSizevalue0isnowdisallowedwhencallingthecursorAPIviaHTTPPOST/_api/cursor.

    TheHTTPRESTAPIPOST/_api/cursordoesnotacceptabatchSizeparametervalueof0anylonger.Abatchsizeof0nevermademuchsense,butpreviousversionsofArangoDBdidnotcheckforthisvalue.NowcreatingacursorusingabatchSizevalue0willresultinanHTTP400errorresponse.

    DocumentURLsreturned

    TheRESTAPImethodGET/_api/document?collection=...(thatmethodwillreturnpartialURLstoalldocumentsinthecollection)willnowproperlyprefixdocumentaddressURLswiththecurrentdatabasename.

    PreviousversionsofArangoDBreturnedtheURLsstartingwith/_api/butwithoutthecurrentdatabasename,e.g./_api/document/mycollection/mykey.Startingwith2.6,theresponseURLswillincludethedatabasenameaswell,e.g./_db/_system/_api/document/mycollection/mykey.

    ArangoDB2.8.9Documentation

    34Incompatiblechangesin2.6

  • Fulltextindexing

    Fulltextindexeswillnowalsoindextextvaluescontainedindirectsub-objectsoftheindexedattribute.

    PreviousversionsofArangoDBonlyindexedtheattributevalueifitwasastring.Sub-attributesoftheindexattributewereignoredwhenfulltextindexing.

    Now,iftheindexattributevalueisanobject,theobject'svalueswilleachbeincludedinthefulltextindexiftheyarestrings.Iftheindexattributevalueisanarray,thearray'svalueswilleachbeincludedinthefulltextindexiftheyarestrings.

    Deprecatedserverfunctionality

    Simplequeries

    Thefollowingsimplequeryfunctionsarenowdeprecated:

    collection.nearcollection.withincollection.geocollection.fulltextcollection.rangecollection.closedRange

    ThisalsoleadtothefollowingRESTAPImethodsbeingdeprecatedfromnowon:

    PUT/_api/simple/nearPUT/_api/simple/withinPUT/_api/simple/fulltextPUT/_api/simple/range

    ItisrecommendedtoreplacecallstothesefunctionsorAPIswithequivalentAQLqueries,whicharemoreflexiblebecausetheycanbecombinedwithotheroperations:

    FORdocINNEAR(@@collection,@latitude,@longitude,@limit)

    RETURNdoc

    FORdocINWITHIN(@@collection,@latitude,@longitude,@radius,@distanceAttributeName)

    RETURNdoc

    FORdocINFULLTEXT(@@collection,@attributeName,@queryString,@limit)

    RETURNdoc

    FORdocIN@@collection

    FILTERdoc.value>=@left&&doc.value<@right

    LIMIT@skip,@limit

    RETURNdoc`

    TheabovesimplequeryfunctionsandRESTAPImethodsmayberemovedinfutureversionsofArangoDB.

    UsingnegativevaluesforSimpleQuery.skip()isalsodeprecated.ThisfunctionalitywillberemovedinfutureversionsofArangoDB.

    AQLfunctions

    TheAQLSKIPLISTfunctionhasbeendeprecatedbecauseitisobsolete.

    ThefunctionwasintroducedinolderversionsofArangoDBwithalesspowerfulqueryoptimizertoretrievedatafromaskiplistindexusingaLIMITclause.

    Since2.3thesamegoalcanbeachievedbyusingregularAQLconstructs,e.g.

    FORdocIN@@collection

    FILTERdoc.value>=@value

    SORTdoc.value

    LIMIT1

    RETURNdoc

    ArangoDB2.8.9Documentation

    35Incompatiblechangesin2.6

  • Startupoptionchanges

    Optionsadded

    Thefollowingconfigurationoptionshavebeenaddedin2.6:

    --server.session-timeout:allowscontrollingthetimeoutofusersessionsinthewebinterface.Thevalueisspecifiedinseconds.

    --server.foxx-queues:controlswhethertheFoxxqueuemanagerwillcheckqueueandjobentries.DisablingthisoptioncanreduceserverloadbutwillpreventjobsaddedtoFoxxqueuesfrombeingprocessedatall.

    Thedefaultvalueistrue,enablingtheFoxxqueuesfeature.

    --server.foxx-queues-poll-interval:allowsadjustingthefrequencywithwhichtheFoxxqueuesmanagerischeckingthequeue(orqueues)forjobstobeexecuted.

    Thedefaultvalueis1second.Loweringthisvaluewillresultinthequeuemanagerwakingupandcheckingthequeuesmorefrequently,whichmayincreaseCPUusageoftheserver.

    Note:thisoptiononlyhasaneffectwhen--server.foxx-queuesisnotsettofalse.

    Optionsremoved

    Thefollowingconfigurationoptionshavebeenremovedin2.6.:

    --log.severity:thedocsfor--log.severitymentionedlotsofseverities(e.g.exception,technical,functional,development)butonlyafewseverities(e.g.all,human)wereactuallyused,withhumanbeingthedefaultandallenablingtheadditionalloggingofincomingrequests.

    Theoptionpretendedtocontrolalotofthingswhichitactuallydidn't.Additionally,theoption--log.requests-filewasaroundforalongtimealready,alsocontrollingrequestlogging.

    Becausethe--log.severityoptioneffectivelydidnotcontrolthatmuch,itwasremoved.Asideeffectofremovingtheoptionisthat2.5installationsstartedwithoption--log.severityallwillnotlogrequestsaftertheupgradeto2.6.Thiscanbeadjustedbysettingthe--log.requests-fileoptioninstead.

    Defaultvalueschanged

    Thedefaultvaluesforthefollowingoptionshavechangedin2.6:

    --database.ignore-datafile-errors:thedefaultvalueforthisoptionwaschangedfromtruetofalse.

    Ifthenewdefaultvalueoffalseisused,thenarangodwillrefuseloadingcollectionsthatcontaindatafileswithCRCmismatchesorothererrors.Acollectionwithdatafileerrorswillthenbecomeunavailable.Thispreventsfollowuperrorsfromhappening.

    Theonlywaytoaccesssuchcollectionistousethedatafiledebugger(arango-dfdb)andtrytorepairortruncatethedatafilewithit.

    --server.request-timeout:thedefaultvaluewasincreasedfrom300to1200secondsforallclienttools(arangosh,arangoimp,arangodump,arangorestore).

    --server.connect-timeout:thedefaultvaluewasincreasedfrom3to5secondsforallclienttools(arangosh,arangoimp,arangodump,arangorestore).

    ArangoDB2.8.9Documentation

    36Incompatiblechangesin2.6

  • UpgradingtoArangoDB2.6PleasereadthefollowingsectionsifyouupgradefromapreviousversiontoArangoDB2.6.Pleasebesurethatyouhavecheckedthelistofchangesin2.6beforeupgrading.

    PleasenotefirstthatadatabasedirectoryusedwithArangoDB2.6cannotbeusedwithearlierversions(e.g.ArangoDB2.5)anymore.Upgradingadatabasedirectorycannotbereverted.ThereforepleasemakesuretocreateafullbackupofyourexistingArangoDBinstallationbeforeperforminganupgrade.

    DatabaseDirectoryVersionCheckandUpgrade

    ArangoDBwillperformadatabaseversioncheckatstartup.WhenArangoDB2.6encountersadatabasecreatedwithearlierversionsofArangoDB,itwillrefusetostart.Thisisintentional.

    Theoutputwillthenlooklikethis:

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':Databasedirectoryversion(20501)islowerthancurrentversion(20600).

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':----------------------------------------------------------------------

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':ItseemslikeyouhaveupgradedtheArangoDBbinary.

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':Ifthisiswhatyouwantedtodo,pleaserestartwiththe

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':--upgrade

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':optiontoupgradethedatainthedatabasedirectory.

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':Normallyyoucanusethecontrolscripttoupgradeyourdatabase

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':/etc/init.d/arangodbstop

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':/etc/init.d/arangodbupgrade

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':/etc/init.d/arangodbstart

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':----------------------------------------------------------------------

    2015-02-17T09:43:11Z[8302]FATALDatabase'_system'needsupgrade.Pleasestarttheserverwiththe--upgradeoption

    TomakeArangoDB2.6startwithadatabasedirectorycreatedwithanearlierArangoDBversion,youmayneedtoinvoketheupgradeprocedureonce.ThiscanbedonebyrunningArangoDBfromthecommandlineandsupplyingthe--upgradeoption.

    Note:herethesamedatabaseshouldbespecifiedthatisalsospecifiedwhenarangodisstartedregularly.Pleasedonotrunthe--upgradecommandoneachindividualdatabasesubfolder(nameddatabase-).

    Forexample,ifyouregularlystartyourArangoDBserverwith

    unix>arangodmydatabasefolder

    thenrunning

    unix>arangodmydatabasefolder--upgrade

    willperformtheupgradeforthewholeArangoDBinstance,includingallofitsdatabases.

    Startingwith--upgradewillrunadatabaseversioncheckandperformanynecessarymigrations.Asusual,youshouldcreateabackupofyourdatabasedirectorybeforeperformingtheupgrade.

    Thelastlineoftheoutputshouldlooklikethis:

    2014-12-22T12:03:31Z[12026]INFOdatabaseupgradepassed

    Pleasecheckthefulloutputthe--upgraderun.Upgradingmayproduceerrors,whichneedtobefixedbeforeArangoDBcanbeusedproperly.Ifnoerrorsarepresentortheyhavebeenresolvedmanually,youcanstartArangoDB2.6regularly.

    Upgradingaclusterplannedinthewebinterface

    ArangoDB2.8.9Documentation

    37Upgradingto2.6

  • AclusterofArangoDBinstanceshastobeupgradedaswell.ThisinvolvesupgradingallArangoDBinstancesinthecluster,aswellasrunningtheversioncheckonthewholerunningclusterintheend.

    Wehavetriedtomakethisprocedureaspainlessandconvenientforyou.Weassumethatyouplanned,launchedandadministratedaclusterusingthegraphicalfrontendinyourbrowser.Theupgradeprocedureisthenasfollows:

    1. Firstshutdownyourclusterusingthegraphicalfrontendasusual.

    2. Thenupgradealldispatcherinstancesonallmachinesinyourclusterusingtheversioncheckasdescribedaboveandrestartthem.

    3. Nowopentheclusterdashboardinyourbrowserbypointingittothesamedispatcherthatyouusedtoplanandlaunchtheclusterinthegraphicalfrontend.Inadditiontotheusualbuttons"Relaunch","Editclusterplan"and"Deleteclusterplan"youwillseeanotherbuttonmarked"Upgradeandrelaunchcluster".

    4. Hitthisbutton,yourclusterwillbeupgradedandlaunchedandallisdoneforyoubehindthescenes.Ifallgoeswell,youwillseetheusualclusterdashboardafterafewseconds.Ifthereisanerror,youhavetoinspectthelogfilesofyourclusterArangoDBinstances.Pleaseletusknowifyourunintoproblems.

    ThereisanalternativewayusingtheArangoDBshell.Insteadofsteps3.and4.aboveyoucanlauncharangosh,pointittothedispatcherthatyouhaveusedtoplanandlaunchtheclusterusingtheoption--server.endpoint,andexecute

    arangosh>require("org/arangodb/cluster").Upgrade("root","");

    Thisupgradestheclusterandlaunchesit,exactlyaswiththebuttonaboveinthegraphicalfrontend.Youhavetoreplace"root"withausernameand""withapasswordthatisvalidforauthenticationwiththecluster.

    ArangoDB2.8.9Documentation

    38Upgradingto2.6

  • IncompatiblechangesinArangoDB2.5ItisrecommendedtocheckthefollowinglistofincompatiblechangesbeforeupgradingtoArangoDB2.5,andadjustanyclientprogramsifnecessary.

    Changedbehavior

    V8

    TheV8versionshippedwithArangoDBwasupgradedfrom3.29.59to3.31.74.1.ThisleadstoadditionalECMAScript6(ES6or"harmony")featuresbeingenabledbydefaultinArangoDB'sscriptingenvironment.

    Apartfromthat,achangeintheinterpretationofcommand-lineoptionsbyV8mayaffectusers.ArangoDBpassesthevalueofthecommand-lineoption--javascript.v8-optionstoV8andleavesinterpretationofthecontentstoV8.Forexample,theArangoDBoption--javascript.v8-options="--harmony"couldbeusedtotellV8toenableitsharmonyfeatures.

    InArangoDB2.4,thefollowingharmonyoptionsweremadeavailablebyV8:

    --harmony_scoping(enableharmonyblockscoping)--harmony_modules(enableharmonymodules(impliesblockscoping))--harmony_proxies(enableharmonyproxies)--harmony_generators(enableharmonygenerators)--harmony_numeric_literals(enableharmonynumericliterals(0o77,0b11))--harmony_strings(enableharmonystring)--harmony_arrays(enableharmonyarrays)--harmony_arrow_functions(enableharmonyarrowfunctions)--harmony_classes(enableharmonyclasses)--harmony_object_literals(enableharmonyobjectliteralextensions)--harmony(enableallharmonyfeatures(exceptproxies))

    Therewastheoption--harmony,whichturnedonalmostallharmonyfeatures.

    InArangoDB2.5,V8providesthefollowingharmony-relatedoptions:

    --harmony(enableallcompletedharmonyfeatures)--harmony_shipping(enableallshippedharmonyfeatures)--harmony_modules(enable"harmonymodules(impliesblockscoping)"(inprogress))--harmony_arrays(enable"harmonyarraymethods"(inprogress))--harmony_array_includes(enable"harmonyArray.prototype.includes"(inprogress))--harmony_regexps(enable"harmonyregularexpressionextensions"(inprogress))--harmony_arrow_functions(enable"harmonyarrowfunctions"(inprogress))--harmony_proxies(enable"harmonyproxies"(inprogress))--harmony_sloppy(enable"harmonyfeaturesinsloppymode"(inprogress))--harmony_unicode(enable"harmonyunicodeescapes"(inprogress))--harmony_tostring(enable"harmonytoString")--harmony_numeric_literals(enable"harmonynumericliterals")--harmony_strings(enable"harmonystringmethods")--harmony_scoping(enable"harmonyblockscoping")--harmony_classes(enable"harmonyclasses(impliesblockscoping&objectliteralextension)")--harmony_object_literals(enable"harmonyobjectliteralextensions")--harmony_templates(enable"harmonytemplateliterals")

    Notethatthereareextraoptionsforbettercontrollingthededicatedfeatures,andespeciallythatthemeaningofthe--harmonyoptionhaschangedfromenablingallharmonyfeaturestoallcompletedharmonyfeatures!

    Usersshouldadjustthevalueof--javascript.v8-optionsaccordingly.

    PleasenotethatincompleteharmonyfeaturesaresubjecttochangeinfutureV8releases.

    ArangoDB2.8.9Documentation

    39Incompatiblechangesin2.5

  • Sparseindexes

    Hashindexesandskiplistindexescannowbecreatedinasparsevariant.Whennotexplicitlyset,thesparseattributedefaultstofalsefornewindexes.

    Thiscausesachangeinbehaviorwhencreatingauniquehashindexwithoutspecifyingthesparseflag.Theuniquehashindexwillbecreatedinanon-sparsevariantinArangoDB2.5.

    In2.4andbefore,uniquehashindexeswereimplicitlysparse,alwaysexcludingnullvaluesfromtheindex.Therewasnooptiontocontrolthisbehavior,andsparsitywasneithersupportedfornon-uniquehashindexesnorskiplistsin2.4.Thisimplicitsparsityofjustuniquehashindexeswasconsideredaninconsistency,andthereforethebehaviorwascleanedupin2.5.

    Asof2.5,hashandskiplistindexeswillonlybecreatedsparseifsparsityisexplicitlyrequested.Thismayrequireachangeinindex-creatingclientcode,butonlyiftheclientcodecreatesuniquehashindexesandiftheyarestillintendedtobesparse.Inthiscase,theclientcodeshouldexplicitlysetthesparseflagtotruewhencreatingauniquehashindex.

    Existinguniquehashindexesfrom2.4orbeforewillautomaticallybemigratedsotheyarestillsparseaftertheupgradeto2.5.Fortheseindexes,thesparseattributewillbepopulatedautomaticallywithavalueoftrue.

    Geoindexesareimplicitlysparse,meaningdocumentswithouttheindexedlocationattributeorcontaininginvalidlocationcoordinatevalueswillbeexcludedfromtheindexautomatically.Thisisalsoachangewhencomparedtopre-2.5behavior,whendocumentswithmissingorinvalidcoordinatevaluesmayhavecausederrorsoninsertionwhenthegeoindex'uniqueflagwassetanditsignoreNullflagwasnot.

    Thiswasconfusingandhasbeenrectifiedin2.5.ThemethodensureGeoConstaint()nowdoesthesameasensureGeoIndex().Furthermore,theattributesconstraint,unique,ignoreNullandsparseflagsarenowcompletelyignoredwhencreatinggeoindexes.ClientindexcreationcodethereforedoesnotneedtosettheignoreNullorconstraintattributeswhencreatingageoindex.

    Thesameistrueforfulltextindexes.Thereisnoneedtospecifynon-uniquenessorsparsityforgeoorfulltextindexes.Theywillalwaysbenon-uniqueandsparse.

    MovedFoxxapplicationstoadifferentfolder.

    Until2.4foxxappswerestoredinthefollowingfolderstructure:/databases//:.Thiscausedsometroubleasappswherecachedbasedonnameandversionandupdatesdidnotapply.Alsothepathonfilesystemandtheapp'saccessURLhadnorelationtooneanother.NowthepathonfilesystemisidenticaltotheURL(excepttheappendedAPP):/_db///APP

    FoxxDevelopmentmode

    Thedevelopmentmodeuseduntil2.4isgone.Ithasbeenreplacedbyamuchmorematureversion.Thisincludesthedeprecationofthejavascript.dev-app-pathparameter,whichisuselesssince2.5.Insteadofhavingtwoseparateappdirectoriesforproductionanddevelopment,appsnowresideinoneplace,whichisusedforproductionaswellasfordevelopment.Appscanstillbeputintodevelopmentmode,changingtheirbehaviorcomparedtoproductionmode.Developmentmodeappsarestillrereadfromdiskateveryrequest,andstilltheyshipmoredebugoutput.

    Thischangehasalsomadethestartupoptions--javascript.frontend-development-modeand--javascript.dev-app-pathobsolete.Theformeroptionwillnothaveanyeffectwhenset,andthelatteroptionisonlyreadandusedduringtheupgradeto2.5anddoesnothaveanyeffectslater.

    Foxxinstallprocess

    InstallingFoxxappshasbeenatwostepprocess:importthemintoArangoDBandmountthemataspecificmountpoint.Theseoperationshavebeenjoinedtogether.Youcaninstallanappatonemountpoint,that'sit.Nofetch,mount,unmount,purgecycleanymore.Thecommandshavebeensimplifiedtojust:

    install:getyourFoxxappupandrunninguninstall:shutitdownanderaseitfromdisk

    Deprecatedfeatures

    ArangoDB2.8.9Documentation

    40Incompatiblechangesin2.5

  • Foxx:methodModel#toJSONSchema(id)isdeprecated,itwillraiseawarningifyouuseit.PleaseuseFoxx.toJSONSchema(id,model)instead.

    Removedfeatures

    Startupswitch--javascript.frontend-development-mode:Itsmajorpurposewasinternaldevelopmentanyway.Nowthewebfrontendcanbesettodevelopmentmodesimilartoanyotherfoxxapp.Startupswitch--javascript.dev-app-path:WasusedforthedevelopmentmodeofFoxx.Thisisintegratedwiththenormalapp-pathnowandcanbetriggeredonapplevel.Thesecondapp-pathissuperfluous.Foxx:controller.collection:PleaseuseappContext.collectioninstead.Foxx:FoxxRepository.modelPrototype:PleaseuseFoxxRepository.modelinstead.Foxx:Model.extend({},{attributes:{}}):PleaseuseModel.extend({schema:{}})instead.Foxx:requestContext.bodyParam(paramName,description,Model):PleaseuserequestContext.bodyParam(paramName,options)instead.Foxx:requestContext.queryParam({type:string}):PleaseuserequestContext.queryParam({type:joi})instead.Foxx:requestContext.pathParam({type:string}):PleaseuserequestContext.pathParam({type:joi})instead.Graph:Themodulesorg/arangodb/graphandorg/arangodb/graph-blueprint:Pleaseusemoduleorg/arangodb/general-graphinstead.NOTE:Thisdoesnotmeanwedonotsupportblueprintsanymore.Generalgraphcoverseverythingthegraph--blueprintdid,plusmanymorefeatures.General-Graph:Inthemoduleorg/arangodb/general-graphthefunctions_undirectedRelationand_directedRelationarenolongeravailable.Bothfunctionshavebeenunifiedto_relation.

    ArangoDB2.8.9Documentation

    41Incompatiblechangesin2.5

  • UpgradingtoArangoDB2.5PleasereadthefollowingsectionsifyouupgradefromapreviousversiontoArangoDB2.5.Pleasebesurethatyouhavecheckedthelistofchangesin2.5beforeupgrading.

    PleasenotefirstthatadatabasedirectoryusedwithArangoDB2.5cannotbeusedwithearlierversions(e.g.ArangoDB2.4)anymore.Upgradingadatabasedirectorycannotbereverted.ThereforepleasemakesuretocreateafullbackupofyourexistingArangoDBinstallationbeforeperforminganupgrade.

    In2.5wehavealsochangedthepathsforFoxxapplications.PleasealsomakesurethatyouhaveabackupofallFoxxappsinyourjavascript.app-pathandjavascript.dev-app-path.ItissufficienttohavethesourcefilesforFoxxsomewhereelsesoyoucanreinstallthemonerror.Tocheckthateverythinghasworkedduringupgradeyoucouldusetheweb-interfaceApplicationstabor

    unix>foxx-managerlist

    forallyourdatabases.Thelistedappsshouldbeidenticalbeforeandaftertheupgrade.

    DatabaseDirectoryVersionCheckandUpgrade

    ArangoDBwillperformadatabaseversioncheckatstartup.WhenArangoDB2.5encountersadatabasecreatedwithearlierversionsofArangoDB,itwillrefusetostart.Thisisintentional.

    Theoutputwillthenlooklikethis:

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':Databasedirectoryversion(20401)islowerthancurrentversion(20500).

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':----------------------------------------------------------------------

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':ItseemslikeyouhaveupgradedtheArangoDBbinary.

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':Ifthisiswhatyouwantedtodo,pleaserestartwiththe

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':--upgrade

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':optiontoupgradethedatainthedatabasedirectory.

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':Normallyyoucanusethecontrolscripttoupgradeyourdatabase

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':/etc/init.d/arangodbstop

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':/etc/init.d/arangodbupgrade

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':/etc/init.d/arangodbstart

    2015-02-17T09:43:11Z[8302]ERRORIndatabase'_system':----------------------------------------------------------------------

    2015-02-17T09:43:11Z[8302]FATALDatabase'_system'needsupgrade.Pleasestarttheserverwiththe--upgradeoption

    TomakeArangoDB2.5startwithadatabasedirectorycreatedwithanearlierArangoDBversion,youmayneedtoinvoketheupgradeprocedureonce.ThiscanbedonebyrunningArangoDBfromthecommandlineandsupplyingthe--upgradeoption.Note:WehavechangedFoxxfolderstructureandimplementedanupgradetasktomoveyourapplicationstothenewstructure.InordertotellthisupgradetasktoalsomoveyourdevelopmentFoxxappspleasemakesureyougivethedev-app-pathaswell.IfyouhavenotuseddevelopmentmodeforFoxxappsyoucandropthe--javascript.dev-app-path.Itisonlypossibletoupgradeonedev-app-pathtogetherwithonedatafolder.

    unix>arangoddata--upgrade--javascript.dev-app-pathdevapps

    wheredataisArangoDB'smaindatadirectoryanddevappsisthedirectorywhereyoudevelopFoxxapps.

    Note:herethesamedatabaseshouldbespecifiedthatisalsospecifiedwhenarangodisstartedregularly.Pleasedonotrunthe--upgradecommandoneachindividualdatabasesubfolder(nameddatabase-).

    Forexample,ifyouregularlystartyourArangoDBserverwith

    unix>arangodmydatabasefolder

    thenrunning

    ArangoDB2.8.9Documentation

    42Upgradingto2.5

  • unix>arangodmydatabasefolder--upgrade

    willperformtheupgradeforthewholeArangoDBinstance,includingallofitsdatabases.

    Startingwith--upgradewillrunadatabaseversioncheckandperformanynecessarymigrations.Asusual,youshouldcreateabackupofyourdatabasedirectorybeforeperformingtheupgrade.

    Thelastlineoftheoutputshouldlooklikethis:

    2014-12-22T12:03:31Z[12026]INFOdatabaseupgradepassed

    Pleasecheckthefulloutputthe--upgraderun.Upgradingmayproduceerrors,whichneedtobefixedbeforeArangoDBcanbeusedproperly.Ifnoerrorsarepresentortheyhavebeenresolvedmanually,youcanstartArangoDB2.5regularly.

    UpgradingaclusterplannedinthewebinterfaceAclusterofArangoDBinstanceshastobeupgradedaswell.ThisinvolvesupgradingallArangoDBinstancesinthecluster,aswellasrunningtheversioncheckonthewholerunningclusterintheend.

    Wehavetriedtomakethisprocedureaspainlessandconvenientforyou.Weassumethatyouplanned,launchedandadministratedaclusterusingthegraphicalfrontendinyourbrowser.Theupgradeprocedureisthenasfollows:

    1. Firstshutdownyourclusterusingthegraphicalfrontendasusual.

    2. Thenupgradealldispatcherinstancesonallmachinesinyourclusterusingtheversioncheckasdescribedaboveandrestartthem.

    3. Nowopentheclusterdashboardinyourbrowserbypointingittothesamedispatcherthatyouusedtoplanandlaunchtheclusterinthegraphicalfrontend.Inadditiontotheusualbuttons"Relaunch","Editclusterplan"and"Deleteclusterplan"youwillseeanotherbuttonmarked"Upgradeandrelaunchcluster".

    4. Hitthisbutton,yourclusterwillbeupgradedandlaunchedandallisdoneforyoubehindthescenes.Ifallgoeswell,youwillseetheusualclusterdashboardafterafewseconds.Ifthereisanerror,youhavetoinspectthelogfilesofyourclusterArangoDBinstances.Pleaseletusknowifyourunintoproblems.

    ThereisanalternativewayusingtheArangoDBshell.Insteadofsteps3.and4.aboveyoucanlauncharangosh,pointittothedispatcherthatyouhaveusedtoplanandlaunchtheclusterusingtheoption--server.endpoint,andexecute

    arangosh>require("org/arangodb/cluster").Upgrade("root","");

    Thisupgradestheclusterandlaunchesit,exactlyaswiththebuttonaboveinthegraphicalfrontend.Youhavetoreplace"root"withausernameand""withapasswordthatisvalidforauthenticationwiththecluster.

    ArangoDB2.8.9Documentation

    43Upgradingto2.5

  • IncompatiblechangesinArangoDB2.4ItisrecommendedtocheckthefollowinglistofincompatiblechangesbeforeupgradingtoArangoDB2.4,andadjustanyclientprogramsifnecessary.

    Changedbehavior

    V8upgrade

    ThebundledV8versionhasbeenupgradedfrom3.16.14to3.29.59.

    Thenewversionprovidesbettererrorchecking,whichcanleadtosubtlechangesintheexecutionofJavaScriptcode.

    Thefollowingcode,thoughnonsense,runswithouterrorin2.3and2.4whenstrictmodeisnotenabled:

    (function(){

    a=true;

    a.foo=1;

    })();

    Whenenablingstrictmode,thefunctionwillthrowanerrorin2.4butnotin2.3:

    (function(){

    "usestrict";

    a=true;

    a.foo=1;

    })();

    TypeError:Cannotassigntoreadonlyproperty'foo'oftrue

    Thoughthisisachangeinbehavioritcanbeconsideredanimprovement.Thenewversionactuallyuncoversanerrorthatwentundetectedintheoldversion.

    Errormessageshavealsochangedslightlyinthenewversion.ApplicationsthatrelyontheexacterrormessagesoftheJavaScriptenginemayneedtobeadjustedsotheylookfortheupdatederrormessages.

    Defaultendpoint

    Thedefaultendpointforarangodisnow127.0.0.1.

    ThischangewillmodifytheIPaddressArangoDBlistensonto127.0.0.1bydefault.ThiswillmakenewArangoDBinstallationsunaccessiblefromclientsotherthanlocalhostunlesstheconfigurationischanged.Thisisasecurityfeature.

    TomakeArangoDBaccessiblefromanyclient,changetheserver'sconfiguration(--server.endpoint)toeithertcp://0.0.0.0:8529ortheserver'spubliclyvisibleIPaddress.

    Replication

    SystemcollectionsarenowincludedinthereplicationandallreplicationAPIreturnvaluesbydefault.

    Thiswillleadtouseraccountsandcredentialsdatabeingreplicatedfrommastertoslaveservers.Thismayoverwriteslave-specificdatabaseusers.

    Thismaybeconsideredafeatureorananti-feature,soitisconfigurable.

    Ifreplicationofsystemcollectionsisundesired,theycanbeexcludedfromreplicationbysettingtheincludeSystemattributetofalseinthefollowingcommands:

    initialsynchronization:replication.sync({includeSystem:false})continuousreplication:replication.applier.properties({includeSystem:false})

    ArangoDB2.8.9Documentation

    44Incompatiblechangesin2.4

  • Thiswillexcludeallsystemcollections(including_aqlfunctions,_graphsetc.)fromtheinitialsynchronizationandthecontinuousreplication.

    Ifthisisalsoundesired,itisalsopossibletospecifyalistofcollectionstoexcludefromtheinitialsynchronizationandthecontinuousreplicationusingtherestrictCollectionsattribute,e.g.:

    require("org/arangodb/replication").applier.properties({

    includeSystem:true,

    restrictType:"exclude",

    restrictCollections:["_users","_graphs","foo"]

    });

    Theaboveexamplewillingeneralincludesystemcollections,butwillexcludethespecifiedthreecollectionsfromcontinuousreplication.

    TheHTTPRESTAPImethodsforfetchingthereplicationinventoryandfordumpingcollectionsalsosupporttheincludeSystemcontrolflagviaaURLparameterofthesamename.

    Buildprocesschanges

    Severaloptionsfortheconfigurecommandhavebeenremovedin2.4.Theoptions

    --enable-all-in-one-v8

    --enable-all-in-one-icu

    --enable-all-in-one-libev

    --with-libev=DIR

    --with-libev-lib=DIR

    --with-v8=DIR

    --with-v8-lib=DIR

    --with-icu-config=FILE

    arenotavailableanymorebecausethebuildprocesswillalwaysusethebundledversionsofthelibraries.

    WhenbuildingArangoDBfromsourceinadirectorythatalreadycontainedapre-2.4version,itwillbenecessarytorunamakesupercleancommandonceandafullrebuildafterwards:

    gitpull

    makesuperclean

    makesetup

    ./configure

    make

    Miscellaneouschanges

    Asaconsequenceofglobalrenaminginthecodebase,theoptionmergeArrayshasbeenrenamedtomergeObjects.ThisoptioncontrolswhetherJSONobjectswillbemergedonanupdateoperationoroverwritten.Thedefaulthasbeen,andstillis,tomerge.Notspecifyingtheparameterwillleadtoamerge,asithasbeenthebehaviorinArangoDBeversince.

    ThisaffectstheHTTPRESTAPImethodPATCH/_api/document/collection/key.ItsoptionalURLparametermergeArraysfortheoptionhasbeenrenamedtomergeObjects.

    TheAQLUPDATEstatementisalsoaffected,asitsoptionmergeArrayshasalsobeenrenamedtomergeObjects.The2.3query

    UPDATEdocINcollectionWITH{...}INcollectionOPTIONS{mergeArrays:false}

    shouldthusberewrittentothefollowingin2.4:

    UPDATEdocINcollectionWITH{...}INcollectionOPTIONS{mergeObjects:false}

    Deprecatedfeatures

    ArangoDB2.8.9Documentation

    45Incompatiblechangesin2.4

  • ForFoxxControllerobjects,themethodcollection()isdeprecatedandwillberemovedinfutureversionofArangoDB.Usingthismethodwillissueawarning.PleaseuseapplicationContext.collection()instead.

    ForFoxxRepositoryobjects,thepropertymodelPrototypeisnowdeprecated.Usingitwillissueawarning.PleaseuseFoxxRepository.modelinstead.

    InFoxxController/RequestContext,callingmethodbodyParam()withthreeargumentsisdeprecated.Pleaseuse.bodyParam(paramName,options)instead.

    InFoxxController/RequestContextcallingmethodqueryParam({type:string})isdeprecated.PleaseuserequestContext.queryParam({type:joi})instead.

    InFoxxController/RequestContextcallingmethodpathParam({type:string})isdeprecated.PleaseuserequestContext.pathParam({type:joi})instead.

    ForFoxxModel,callingModel.extend({},{attributes:{}})isdeprecated.PleaseuseModel.extend({schema:{}})instead.

    Inmoduleorg/arangodb/general-graph,thefunctions_undirectedRelation()and_directedRelation()aredeprecatedandwillberemovedinafutureversionofArangoDB.Bothfunctionshavebeenunifiedto_relation().

    Themodulesorg/arangodb/gr