confdb

Queries databases, collections, documents, and commit logs in the configuration database (ConfigDatabase). Administrator privilege is required to run this command.

Command properties

ItemDescription
Command typeDriver query
Required permissionAdministrator
License usageN/A
Parallel executionNot supported
Distributed executionNot supported

Syntax

To list databases:

confdb databases

To list collections:

confdb cols DB_NAME

To query documents:

confdb docs DB_NAME COL_NAME

To query commit logs:

confdb logs DB_NAME

Target

OP
Query type to perform.
  • databases: Lists all databases in the configuration database.
  • cols: Lists collections in the specified database.
  • docs: Queries documents in a collection within the specified database.
  • logs: Queries commit logs for the specified database.
DB_NAME
Target database name. Required for cols, docs, and logs queries.
COL_NAME
Target collection name. Required for docs queries.

Output fields

For databases queries:

FieldTypeDescription
namestringDatabase name
revlongLatest revision number
commitslongNumber of commits
last_msgstringLast commit message
last_committimestampLast commit time

For cols queries:

FieldTypeDescription
namestringCollection name

For docs queries:

FieldTypeDescription
doc_idintegerDocument identifier
doc_previntegerPrevious revision number
doc_revintegerCurrent revision number
docobjectDocument content. When the document is a map type, each key-value pair is assigned as an individual field.

For logs queries:

FieldTypeDescription
_timetimestampCommit time
rev_idlongRevision identifier
committerstringAccount that performed the commit
msgstringCommit message
manifest_idlongManifest identifier. Assigned only when the configuration database supports it.

Error codes

Parse errors
Error codeMessageDescription
10000Permission denied. Administrator privilege is required.Administrator privilege is absent.
10001No option value entered.No query type (databases, cols, docs, logs) is specified.
10002Enter the confdb database name.No database name is specified for cols, docs, or logs queries.
10003Enter the confdb collection name.No collection name is specified for docs queries.
10004[op] is an unsupported option.An unsupported query type is specified.
Runtime errors

N/A

Description

The confdb command directly queries the internal data of the system configuration database.

  • databases query: Returns a list of all databases along with each database's revision number, commit count, and last commit information.
  • cols query: Returns a list of collection names in the specified database. Returns no results if the database does not exist.
  • docs query: Returns all documents in the specified collection. When a document is a map type, each key-value pair is assigned as an individual output field. Otherwise, the entire document is assigned to the doc field.
  • logs query: Returns commit logs for the specified database in batches of up to 1,000 records.

Examples

  1. Listing databases

    confdb databases
    

    Lists all databases in the configuration database.

  2. Listing collections

    confdb cols araqne-log-api
    

    Lists all collections in the araqne-log-api database.

  3. Querying documents

    confdb docs araqne-log-api logger
    

    Queries all documents in the logger collection of the araqne-log-api database.

  4. Querying commit logs

    confdb logs araqne-log-api
    

    Queries the commit logs for the araqne-log-api database.