Apache CouchDB Database Management in VS Code
Overview
Section titled “Overview”Apache CouchDB is an open-source, document-oriented NoSQL database that stores data as JSON documents and is accessed entirely over an HTTP/REST API. Key advantages include:
- Document model: Store schema-free JSON documents, each with its own
_idand revision (_rev) - Mango queries: Query documents with a simple JSON selector language via
_find - HTTP/REST API: Everything is an HTTP request, so no native driver is required
- Multi-version concurrency control: Lock-free reads and optimistic writes via document revisions
- Replication: Robust, incremental, bi-directional replication for offline-first and distributed setups
CouchDB is well suited to offline-first applications, content storage, and systems that need reliable replication across nodes or devices.
Connecting
Section titled “Connecting”To connect to CouchDB in DBCode:
- Open the DBCode Extension: Launch Visual Studio Code and open the DBCode extension.
- Add a New Connection: Click on the “Add Connection” icon.
- Complete connection form: Select Apache CouchDB as the database type and enter:
- Host and port (default
5984, or6984for TLS) - Username and password (CouchDB 3.x requires a server admin user)
- SSL/TLS settings (if required)
- An optional default database
- Host and port (default
- Connect: Click save to establish your connection.
- Start Managing Your Data: Browse databases, documents, and indexes.
For detailed instructions on connecting, refer to the Connect article.
CouchDB Features in DBCode
Section titled “CouchDB Features in DBCode”DBCode brings CouchDB into your editor with:
- Database tree: Each CouchDB database shows its All Documents collection and its Mango Indexes
- Mango query editor: Write JSON
_findqueries (for example,{ "selector": { "year": { "$gte": 2010 } } }) that run against the active database; point-and-click grid filtering builds Mango for you - JSON document editing: View and edit documents in the grid; updates are applied safely using the document’s current revision (
_rev), with clear conflict messages - Index management: Create and drop Mango (JSON) indexes
- EXPLAIN: See which index a Mango query uses via CouchDB’s
_explain - Monitoring: Inspect active tasks, node statistics, and cluster membership
- Read-only connections: Mark a connection read-only to block every write and DDL while still allowing queries and browsing
By using CouchDB with DBCode, you can manage your document databases directly within Visual Studio Code.
For more information about Apache CouchDB, check out Apache CouchDB.