0% found this document useful (0 votes)
351 views

Arangodb: Shell Reference Acard

This document provides a summary of common commands and methods for interacting with ArangoDB using the arangod daemon and arangosh shell. It outlines options for starting and configuring arangod, methods for managing databases and collections, performing queries, and basic CRUD operations on documents and edges.

Uploaded by

hamsternipples
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
351 views

Arangodb: Shell Reference Acard

This document provides a summary of common commands and methods for interacting with ArangoDB using the arangod daemon and arangosh shell. It outlines options for starting and configuring arangod, methods for managing databases and collections, performing queries, and basic CRUD operations on documents and edges.

Uploaded by

hamsternipples
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

collection"update(document) collection"remove(document) Starting & accessing arangod /path/to/my/db arangod --console --log error /path/to/my/db http://localhost:8529/ admin/html/inde!

"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

db" replace(document.document-handle'data) replace e!isting 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

get documents near the given coordinates

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

You might also like