ArangoDB Logo
ArangoDB Logo
  • Manual
  • AQL
  • HTTP
  • Drivers
  • ArangoGraph
  • 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
    • Reduce Memory Footprint
    • ArangoDB Starter
    • Datacenter-to-Datacenter Replication
    • Kubernetes
      • Amazon EKS
      • Google GKE
      • Azure AKS
    • DC2DC on Kubernetes
  • Programs & Tools
    • ArangoDB Server
      • Options
        • General
        • Agency
        • ArangoSearch
        • Audit
        • Cache
        • Backup
        • Cluster
        • Database
        • Foxx
        • Frontend
        • HTTP
        • JavaScript
        • LDAP
        • Log
        • Network
        • Nonce
        • Query
        • Random
        • Replication
        • Rclone
        • RocksDB
        • Server
        • SSL
        • TCP
        • Temp
        • Transaction
        • TTL
        • VST
      • Environment variables
    • 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
    • arangobackup
      • Examples
      • Options
    • arangoimport
      • Examples JSON
      • Examples CSV
      • Details
      • Options
    • arangoexport
      • Examples
      • Options
    • arangobench
      • Options
    • arangovpack
      • Options
    • arangoinspect
      • Examples
      • Options
    • Foxx CLI
      • Details
  • CORE TOPICS
  • Data Model & Concepts
    • Databases
      • Working with Databases
      • Notes about Databases
    • Collections
      • Collection Methods
      • Database Methods
    • Documents
      • Basics and Terminology
      • Collection Methods
      • Database Methods
      • Schema Validation
    • Graphs, Vertices & Edges
    • Views
      • Database Methods
      • View Methods
    • Naming Conventions
      • Database Names
      • Collection and View Names
      • Document Keys
      • Attribute Names
  • Modeling Data
    • Operational Factors
    • Mapping RDF to Graphs
    • Monetary data without precision loss
  • Indexing
    • Index Basics
    • Which index to use when
    • Index Utilization
    • Working with Indexes
      • Persistent Indexes
      • TTL Indexes
      • Fulltext Indexes
      • Multi-dimensional Indexes
      • Geo-spatial Indexes
      • Vertex-centric Indexes
    • ArangoSearch
      • Example Datasets
      • Exact value matching
      • Range Queries
      • Prefix matching
      • Case-sensitivity and Diacritics
      • Wildcard search
      • Full-text token search
      • Phrase and proximity search
      • Faceted search
      • Fuzzy search
      • Geospatial search
      • Ranking
      • Performance
      • Views Reference
  • Transactions
    • JavaScript Transactions
    • Stream Transactions
    • Locking and isolation
    • Durability
    • Limitations
  • Graphs
    • General Graphs
      • Graph Management
      • Graph Functions
    • SatelliteGraphs
      • Management
      • Details
    • SmartGraphs
      • Getting Started with SmartGraphs
      • SmartGraph Management
    • Traversals
      • Example Data
    • Working with Edges
  • Data Science
    • ArangoGraph Notebooks
    • Pregel
      • Pregel Algorithms
    • ArangoDB-NetworkX Adapter
    • ArangoDB-DGL Adapter
    • ArangoDB-cuGraph Adapter
    • ArangoDB-PyG Adapter
    • ArangoRDF Adapter
  • ADVANCED TOPICS
  • Architecture
    • ArangoDB Deployment Modes
      • Single Instance
      • Active Failover
        • Architecture
        • Limitations
      • Cluster
        • Architecture
        • Data Models
        • Data Sharding
        • Limitations
      • Datacenter-to-Datacenter Replication
        • Introduction
        • Applicability
        • Requirements
        • Limitations
    • Single Instance vs. Cluster
    • Storage Engine
    • 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
    • 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
  • SatelliteCollections
  • SmartJoins
  • Analyzers
  • OPERATIONS
  • Installation
    • Linux
      • Operating System Configuration
      • Linux OS Tuning Script Examples
    • macOS
    • Windows
    • Compiling
      • Compile on Debian
      • Compile on Windows
      • Running Custom Build
      • Recompiling jemalloc
  • Uninstallation
  • Deployment
    • By ArangoDB Deployment Modes
      • Single Instance
        • Using the ArangoDB Starter
        • 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
      • 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
  • Downgrading
  • Scaling
  • Administration
    • Configuration
    • License Management
    • Import & Export
    • User Management
      • In arangosh
    • Active Failover
    • Cluster
    • Datacenter-to-Datacenter Replication
    • ArangoDB Starter Administration
      • Removal Procedure
      • 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.9
      • What's New in 3.9
      • Known Issues in 3.9
      • Incompatible changes in 3.9
      • API changes in 3.9
    • Version 3.8
      • What's New in 3.8
      • Known Issues in 3.8
      • Incompatible changes in 3.8
      • API changes in 3.8
    • Version 3.7
      • What's New in 3.7
      • Known Issues in 3.7
      • Incompatible changes in 3.7
      • API changes in 3.7
    • Version 3.6
      • What's New in 3.6
      • Known Issues in 3.6
      • Incompatible changes in 3.6
    • Version 3.5
      • What's New in 3.5
      • Known Issues in 3.5
      • Incompatible changes in 3.5
    • 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
      • analyzers
      • console
      • crypto
      • fs
      • request
      • actions
      • queries
      • Task Management
    • Deprecated
    • Error codes and meanings
    • Glossary
Contribute

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

This documentation is outdated. Please see the most recent version at docs.arangodb.com

The “db” Object

The db object is available in arangosh by default, and can also be imported and used in Foxx services.

db.name returns a collection object for the collection name.

The following methods exist on the _db object:

Database

  • db._createDatabase(name, options, users)
  • db._databases()
  • db._dropDatabase(name, options, users)
  • db._useDatabase(name)

Indexes

  • db._index(index)
  • db._dropIndex(index)

Properties

  • db._id()
  • db._isSystem()
  • db._name()
  • db._path()
  • db._properties()

Collection

  • db._collection(name)
  • db._collections()
  • db._create(name)
  • db._drop(name)
  • db._truncate(name)

AQL

  • db._createStatement(query)
  • db._query(query)
  • db._explain(query)
  • db._parse(query)

Document

  • db._document(object)
  • db._exists(object)
  • db._remove(selector)
  • db._replace(selector,data)
  • db._update(selector,data)

Views

  • db._view(name)
  • db._views()
  • db._createView(name, type, properties)
  • db._dropView(name)

Global

  • db._compact()
  • db._engine()
  • db._engineStats()
  • db._createTransaction()
  • db._executeTransaction()
  • db._version()

License

  • db._getLicense()]
  • db._setLicense(data)]
❮  References collection  ❯

© ArangoDB - Graph and Beyond