Nov 1, 2021

Storage / MongoDB Routes

The Storage/MongoDB Joint API routes can perform basic CRUD operations on documents in a database collection, such as listing, getting, deleting, and updating documents by their _id. The _id is a unique identifier for each document in a MongoDB collection. It is used to uniquely identify a document in the collection and to perform requested operations.

These routes offer comprehensive control over collected data, i.e., the data extracted and saved in the DEX8 platform.

GET /joint-api/mongo/:db_id/:collection/list?limit=&skip=&sort=&select=

List documents from the database collection.

URL Parameters
  • db_id :string - the MongoDB database ID value (see in the Web Panel), e.g., 5ed10185256ce502b869e2a6
  • collection :string - the MongoDB collection name, e.g., myExtractedData
URL Search Query Parameters
  • limit :number - the number of returned documents
  • skip :number - the number of skipped documents
  • sort :string - sort the listed documents, e.g., "last_name -age" (minus means descending)
  • select :string - specify fields to be shown, e.g., "first_name last_name -age" (minus means exclude the field)

GET /joint-api/mongo/:db_id/:collection/:doc_id?select=

Get a document from the database collection by _id.

URL Parameters
  • db_id :string - the MongoDB database ID value (see in the Web Panel), e.g., 5ed10185256ce502b869e2a6
  • collection :string - the MongoDB collection name, e.g., myExtractedData
  • doc_id :string - the MongoDB document ID value, e.g., 5ed10185256ce502b869e2a6
URL Search Query Parameters
  • select :string - specify fields to be shown, e.g., "first_name last_name -age" (minus means exclude the field)

DELETE /joint-api/mongo/:db_id/:collection/:doc_id

Delete a document from the database collection by _id.

URL Parameters
  • db_id :string - the MongoDB database ID value (see in the Web Panel), e.g., 5ed10185256ce502b869e2a6
  • collection :string - the MongoDB collection name, e.g., myExtractedData
  • doc_id :string - the MongoDB document ID value, e.g., 5ed10185256ce502b869e2a6

PUT /joint-api/mongo/:db_id/:collection/:doc_id

Update a document from the database collection by _id. The body object can contain any field defined by the document schema.

URL Parameters
  • db_id :string - the MongoDB database ID value (see in the Web Panel), e.g., 5ed10185256ce502b869e2a6
  • collection :string - the MongoDB collection name, e.g., myExtractedData
  • doc_id :string - the MongoDB document ID value, e.g., 5ed10185256ce502b869e2a6
Body Parameters
The body object defines the new document fields.