ArangoDB Logo
ArangoDB Logo
  • Manual
  • AQL
  • HTTP
  • Cookbook
  • Drivers
  • Google Groups
  • Introduction
  • Highlights
  • GETTING FAMILIAR
  • Getting Started
    • Installation
    • Authentication
    • Web Interface
    • Databases, Collections and Documents
    • Querying the Database
    • Coming from SQL
    • Next Steps
  • Tutorials
    • ArangoDB Starter
    • Datacenter to datacenter Replication
    • Kubernetes
      • Amazon EKS
      • Google GKE
      • Azure AKS
    • DC2DC on Kubernetes
  • Programs & Tools
    • ArangoDB Server
      • Options
        • Global
        • Agency
        • ArangoSearch
        • Audit
        • Cache
        • Cluster
        • Compaction
        • Database
        • Foxx
        • Frontend
        • HTTP
        • JavaScript
        • LDAP
        • Log
        • Nonce
        • Query
        • Random
        • Replication
        • RocksDB
        • Server
        • SSL
        • TCP
        • Temp
        • VST
        • WAL
    • Web Interface
      • Dashboard
      • Cluster
      • Collections
      • Document
      • Queries
      • Graphs
      • Services
      • Users
      • Logs
    • ArangoDB Shell
      • Examples
      • Details
      • Options
    • ArangoDB Starter
      • Options
      • Security
      • Architecture
    • Arangodump
      • Examples
      • Options
      • Maskings
      • Limitations
    • Arangorestore
      • Examples
      • Fast Cluster Restore
      • Options
    • Arangoimport
      • Examples JSON
      • Examples CSV
      • Details
      • Options
    • Arangoexport
      • Examples
      • Options
    • Arangobench
      • Examples
      • Options
    • Arangoinspect
      • Examples
      • Options
    • Datafile Debugger
      • Examples
    • Foxx CLI
      • Details
  • CORE TOPICS
  • Data models & modeling
    • Concepts
    • Databases
      • Working with Databases
      • Notes about Databases
    • Collections
      • Collection Methods
      • Database Methods
    • Documents
      • Basics and Terminology
      • Collection Methods
      • Database Methods
    • Graphs, Vertices & Edges
    • Views
      • Database Methods
      • View Methods
    • Naming Conventions
      • Database Names
      • Collection and View Names
      • Document Keys
      • Attribute Names
    • Operational Factors
  • Indexing
    • Index Basics
    • Which index to use when
    • Index Utilization
    • Working with Indexes
      • Hash Indexes
      • Skiplists
      • Persistent
      • Fulltext Indexes
      • Geo-spatial Indexes
      • Vertex Centric Indexes
  • Transactions
    • Transaction invocation
    • Passing parameters
    • Locking and isolation
    • Durability
    • Limitations
  • Graphs
    • General Graphs
      • Graph Management
      • Graph Functions
    • SmartGraphs
      • SmartGraph Management
    • Traversals
      • Using Traversal Objects
      • Example Data
    • Working with Edges
    • Pregel
  • ArangoSearch Views
    • Getting Started
    • Detailed Overview
    • Analyzers
    • Scorers
  • ADVANCED TOPICS
  • Architecture
    • ArangoDB Deployment Modes
      • Single Instance
      • Master/Slave
        • Architecture
        • Limitations
      • Active Failover
        • Architecture
        • Limitations
      • Cluster
        • Architecture
        • Data models
        • Limitations
      • Datacenter to datacenter replication
        • Introduction
        • Applicability
        • Requirements
        • Limitations
    • Single Instance vs. Cluster
    • Storage Engines
    • Replication
    • Write-ahead log
  • Foxx Microservices
    • Getting started
    • Guides
      • Working with routers
      • Working with collections
      • Writing queries
      • Development mode
      • Testing Foxx services
      • Foxx in a cluster
      • Scripts and scheduling
      • Using Node modules
      • Using Webpack with Foxx
      • Authentication and sessions
      • Linking services together
      • Working with files
      • Making requests
      • Access from the browser
      • Working with 2.x services
    • Reference
      • Service manifest
      • Service context
      • Configuration
      • Routers
        • Endpoints
        • Middleware
        • Request
        • Response
      • Sessions middleware
        • Session storages
          • Collection storage
          • JWT storage
        • Session transports
          • Cookie transport
          • Header transport
      • Related modules
        • Authentication
        • OAuth 1.0a
        • OAuth 2.0
        • GraphQL
        • Queues
    • Deployment
    • Migrating 2.x services
      • Migrating from pre-2.8
      • manifest.json
      • applicationContext
      • Repositories and Models
      • Controllers
        • Request context
        • Error handling
        • Before/After/Around
        • Request object
        • Response object
        • Dependency Injection
      • Sessions
      • Auth and OAuth2
      • Foxx Queries
  • SatelliteCollections
  • SmartJoins
  • OPERATIONS
  • Installation
    • Linux
      • Operating System Configuration
      • Linux OS Tuning Script Examples
    • macOS
    • Windows
    • Compiling
  • Uninstallation
  • Deployment
    • By ArangoDB Deployment Modes
      • Single Instance
        • Using the ArangoDB Starter
        • Manual Start
      • Master/Slave
        • Manual Start
      • Active Failover
        • Using the ArangoDB Starter
        • Manual Start
      • Cluster
        • Preliminary Information
        • Using the ArangoDB Starter
        • Manual Start
        • Kubernetes
      • Multiple Datacenters
        • Cluster
        • ArangoSync Master
        • ArangoSync Workers
        • Prometheus & Grafana
        • Kafka & Zookeeper
      • Standalone Agency
    • By Technology
      • Manually
      • ArangoDB Starter
      • Docker
      • Kubernetes
        • Using the Operator
        • Dashboards
        • Deployment Resource Reference
        • Backup Resource
        • BackupPolicy Resource
        • Driver Configuration
        • Helm
        • Authentication
        • Scaling
        • Draining Nodes
        • Upgrading
        • ArangoDB Configuration & Secrets
        • Metrics
        • Services & Load balancer
        • Deployment Replication Resource Reference
        • Storage
        • Storage Resource
        • TLS
        • Troubleshooting
    • In the Cloud
      • AWS
      • Azure
    • Production Checklist
    • Migrating Single Instance to Cluster
  • Backup & Restore
  • Upgrading
    • General Upgrade Information
    • Community to Enterprise Upgrade
    • OS-specific Information
      • Upgrading on Linux
      • Upgrading on macOS
      • Upgrading on Windows
    • Upgrading Starter Deployments
    • Upgrading Manual Deployments
      • Upgrading an Active Failover deployment
      • Upgrading a Cluster
    • Upgrading Kubernetes Deployments
    • Version Specific Upgrade Information
      • Upgrading to 3.4
      • Upgrading to 3.3
      • Upgrading to 3.2
      • Upgrading to 3.1
      • Upgrading to 3.0
      • Upgrading to 2.8
      • Upgrading to 2.6
      • Upgrading to 2.5
      • Upgrading to 2.4
      • Upgrading to 2.3
      • Upgrading to 2.2
  • Downgrading
  • Scaling
  • Administration
    • Configuration
    • Import & Export
    • User Management
      • In Arangosh
    • Switch Storage Engine
    • Master/Slave
      • Setting up
        • Replication Applier
        • Per-Database Setup
        • Server-Level Setup
      • Syncing Collections
    • Active Failover
    • Cluster
    • Datacenter to datacenter replication
    • ArangoDB Starter Administration
      • ArangoDB Starter Removal Procedure
      • ArangoDB Starter Recovery Procedure
  • Security
    • Security Options
    • Change Root Password
    • Encryption at Rest
    • Auditing
      • Configuration
      • Events
    • Securing Starter Deployments
    • Datacenter to datacenter replication
  • Monitoring
    • Log Levels
    • Datacenter to datacenter replication
  • Troubleshooting
    • arangod
    • Emergency Console
    • Cluster
      • Agency Dump
    • Datacenter to datacenter replication

  • Release Notes
    • Version 3.4
      • What's New in 3.4
      • Known Issues in 3.4
      • Incompatible changes in 3.4
    • Version 3.3
      • What's New in 3.3
      • Known Issues in 3.3
      • Incompatible changes in 3.3
    • Version 3.2
      • What's New in 3.2
      • Known Issues in 3.2
      • Incompatible changes in 3.2
    • Version 3.1
      • What's New in 3.1
      • Incompatible changes in 3.1
    • Version 3.0
      • What's New in 3.0
      • Incompatible changes in 3.0
    • Version 2.8
      • What's New in 2.8
      • Incompatible changes in 2.8
    • Version 2.7
      • What's New in 2.7
      • Incompatible changes in 2.7
    • Version 2.6
      • What's New in 2.6
      • Incompatible changes in 2.6
    • Version 2.5
      • What's New in 2.5
      • Incompatible changes in 2.5
    • Version 2.4
      • What's New in 2.4
      • Incompatible changes in 2.4
    • Version 2.3
      • What's New in 2.3
      • Incompatible changes in 2.3
    • Version 2.2
      • What's New in 2.2
    • Version 2.1
      • What's New in 2.1
  • Appendix
    • References
      • db
      • collection
      • cursor
    • JavaScript Modules
      • @arangodb
      • console
      • crypto
      • fs
      • request
      • actions
      • queries
      • Write-ahead log
      • Task Management
    • Deprecated
      • Simple Queries
        • Pagination
        • Modification Queries
        • Geo Queries
        • Fulltext Queries
      • Actions
        • Delivering HTML Pages
        • Json Objects
        • Modifying
    • Error codes and meanings
    • Glossary
Contribute

ArangoDB v3.4 reached End of Life (EOL) and is no longer supported.

This documentation is outdated. Please see the most recent version here: Latest Docs

The “collection” Object

The following methods exist on the collection object (returned by db.name):

Collection

  • collection.checksum()
  • collection.compact()
  • collection.count()
  • collection.drop()
  • collection.figures()
  • collection.load()
  • collection.properties(options)
  • collection.revision()
  • collection.rotate()
  • collection.toArray()
  • collection.truncate()
  • collection.type()
  • collection.unload()

Indexes

  • collection.dropIndex(index)
  • collection.ensureIndex(description)
  • collection.getIndexes(name)
  • collection.index(index)

Document

  • collection.all()
  • collection.any()
  • collection.byExample(example)
  • collection.closedRange(attribute, left, right)
  • collection.document(object)
  • collection.documents(keys)
  • collection.edges(vertex-id)
  • collection.exists(object)
  • collection.firstExample(example)
  • collection.inEdges(vertex-id)
  • collection.insert(data)
  • collection.edges(vertices)
  • collection.iterate(iterator,options)
  • collection.outEdges(vertex-id)
  • collection.range(attribute, left, right)
  • collection.remove(selector)
  • collection.removeByExample(example)
  • collection.removeByKeys(keys)
  • collection.rename()
  • collection.replace(selector, data)
  • collection.replaceByExample(example, data)
  • collection.save(data)
  • collection.update(selector, data)
  • collection.updateByExample(example, data)
❮  db cursor  ❯

© ArangoDB - the native multi-model NoSQL database