Arangodb: Shell Reference Acard
Arangodb: Shell Reference Acard
"html arangosh arangod frequently used options --log --server"endpoint protocol://host:port --daemon set log level: error' warning' in#o' debug' trace set address and port #or ())* clients (e"g" tcp://localhost:8529' ssl://localhost:8529) run as daemon/bac+ground process start server start emergency console (do not use with a db which has a server attached to it!) access admin #ront end in browser start $rango%& shell db" document(document.document-handle) db" update(document) db" remove(document) Edges in arangosh edge-collection"save(from' to' document) edge-collection"edges(vertex) edge-collection"in,dges(vertices) edge-collection"out,dges(vertices) Queries in arangosh db" /uery(query)"to$rray() collection"all() collection"any() collection"by,!ample(example) collection"#irst,!ample(example) collection"range(attribute' left' right) collection"remove&y,!ample(example) collection" replace&y,!ample (example' new alue) get collection list all collections get a collection by name drop collection with inde!es remove collection' +eep inde!es Geo Queries in arangosh drop collection with all data and inde!es remove all documents' +eep inde!es get collection properties change collection properties get collection #igures (dis+ space etc") load collection into memory start to unload a collection rename collection to new-name collection"near(latitude' longitude) collection" update&y,!ample (example' new alue) collection"count() collection"to$rray()
partially update remove document get document by identi#ier.handle partially update document remove document
save new edge #ind edges #rom (outbound) to (inbound) verte! #ind all edges ending in (inbound) #ind all edges starting #rom (outbound)
run an ad-hoc $01 /uery select all documents and return cursor select a random document select all documents that matches the given example select the #irst document that matches the given example select all documents with attribute 23 left and 4 right remove all documents that match the e!ample remove all documents that match the e!ample remove all documents that match the e!ample return the number o# documents convert the collection into an array o# documents (might be big' not #or production!)
Database management methods in arangosh db" create%atabase(database-name) db" drop%atabase(database-name) db" use%atabase(database-name) db" list%atabases() create database drop a database change into an e!isting database list all databases
Collection management methods in arangosh db" create(collection-name' properties) db" create,dge-ollection(collection-name' properties) db" collection(collection-name.collection-id) db" collections() db"collection-name db" drop(collection-name.collection-id) db" truncate(collection-name.collection-id) Collection methods in arangosh collection"drop() collection"truncate() collection"properties() collection"properties(properties) collection"#igures() collection"load() collection"unload() collection"rename(new-name) Document methods in arangosh collection"document(document) collection"save(data) collection"replace(document' data) get document by identi#ier create new document replace e!isting document create collection (with optional properties) create an edge collection
collection"within(latitude' longitude' distance) get all documents within a radious o# distance around the given coordinates collection"geo(location) the ne!t near or within operator will use the speci#ic geo-spatial inde!
Sequential Access And Cursors in arangosh cursor"has5e!t() cursor"ne!t() cursor"dispose() cursor"count() returns true i# the cursor still has documents advance cursor #ree resources associated with a cursor returns number o# documents in the result set