{"openapi":"3.0.1","info":{"title":"Database Explorer API","description":"API for exploring MongoDB databases, collections, and documents","contact":{"name":"Leucine Onboarding","url":"https://www.leucine.com","email":"support@leucine.com"},"license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0"},"version":"1.0.0"},"externalDocs":{"description":"Database Documentation","url":"/databases"},"servers":[{"url":"/","description":"Default Server URL"}],"security":[{"serviceId":[]}],"tags":[{"name":"Database API","description":"API for exploring MongoDB databases, collections, and documents"}],"paths":{"/api/databases/{databaseName}/collections/{collectionName}/search":{"post":{"tags":["Database API"],"summary":"Search documents","description":"Searches for documents in a specific collection based on a query","operationId":"searchDocuments","parameters":[{"name":"databaseName","in":"path","description":"Name of the database","required":true,"schema":{"type":"string"}},{"name":"collectionName","in":"path","description":"Name of the collection","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum number of documents to retrieve","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"Query document"}}},"required":true},"responses":{"400":{"description":"Bad request","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}},"200":{"description":"Successfully retrieved matching documents","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}},"500":{"description":"Internal server error","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}}}}},"/api/databases/{databaseName}/collections/{collectionName}/indexes":{"post":{"tags":["Database API"],"summary":"Create index","description":"Creates an index on a specific field in a collection","operationId":"createIndex","parameters":[{"name":"databaseName","in":"path","description":"Name of the database","required":true,"schema":{"type":"string"}},{"name":"collectionName","in":"path","description":"Name of the collection","required":true,"schema":{"type":"string"}},{"name":"field","in":"query","description":"Field to index","required":true,"schema":{"type":"string"}},{"name":"unique","in":"query","description":"Whether the index should be unique","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"400":{"description":"Bad request","content":{"*/*":{"schema":{"type":"string"}}}},"200":{"description":"Successfully created index","content":{"*/*":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/api/databases":{"get":{"tags":["Database API"],"summary":"Get all databases","description":"Returns a list of all available databases (excluding system databases)","operationId":"getAllDatabases","responses":{"500":{"description":"Internal server error","content":{"*/*":{"schema":{"type":"array","items":{"type":"string"}}}}},"200":{"description":"Successfully retrieved list of databases","content":{"*/*":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/api/databases/{databaseName}/collections":{"get":{"tags":["Database API"],"summary":"Get collections with counts","description":"Returns a map of collections and their document counts for a specific database","operationId":"getCollectionsWithCounts","parameters":[{"name":"databaseName","in":"path","description":"Name of the database","required":true,"schema":{"type":"string"}}],"responses":{"500":{"description":"Internal server error","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"integer","format":"int64"}}}}},"200":{"description":"Successfully retrieved collections with counts","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"integer","format":"int64"}}}}}}}},"/api/databases/{databaseName}/collections/{collectionName}/metadata":{"get":{"tags":["Database API"],"summary":"Get collection metadata","description":"Returns metadata about a specific collection, including indexes and stats","operationId":"getCollectionMetadata","parameters":[{"name":"databaseName","in":"path","description":"Name of the database","required":true,"schema":{"type":"string"}},{"name":"collectionName","in":"path","description":"Name of the collection","required":true,"schema":{"type":"string"}}],"responses":{"400":{"description":"Bad request","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}}},"200":{"description":"Successfully retrieved collection metadata","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}}},"500":{"description":"Internal server error","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}}}}}},"/api/databases/{databaseName}/collections/{collectionName}/documents":{"get":{"tags":["Database API"],"summary":"Get documents from collection","description":"Returns documents from a specific collection in a database","operationId":"getDocumentsFromCollection","parameters":[{"name":"databaseName","in":"path","description":"Name of the database","required":true,"schema":{"type":"string"}},{"name":"collectionName","in":"path","description":"Name of the collection","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum number of documents to retrieve","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"Successfully retrieved documents","content":{"*/*":{"schema":{"type":"object"}}}},"500":{"description":"Internal server error","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/databases/{databaseName}/collections/{collectionName}/documents/{id}":{"get":{"tags":["Database API"],"summary":"Get document by ID","description":"Returns a document by ID from a specific collection in a database","operationId":"getDocumentById","parameters":[{"name":"databaseName","in":"path","description":"Name of the database","required":true,"schema":{"type":"string"}},{"name":"collectionName","in":"path","description":"Name of the collection","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"ID of the document","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved document","content":{"*/*":{"schema":{"type":"object"}}}},"404":{"description":"Document not found","content":{"*/*":{"schema":{"type":"object"}}}},"500":{"description":"Internal server error","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/databases/{databaseName}/collections/{collectionName}/count":{"get":{"tags":["Database API"],"summary":"Get document count","description":"Returns the count of documents in a specific collection","operationId":"getDocumentCount","parameters":[{"name":"databaseName","in":"path","description":"Name of the database","required":true,"schema":{"type":"string"}},{"name":"collectionName","in":"path","description":"Name of the collection","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved document count","content":{"*/*":{"schema":{"type":"integer","format":"int64"}}}},"400":{"description":"Bad request","content":{"*/*":{"schema":{"type":"integer","format":"int64"}}}},"500":{"description":"Internal server error","content":{"*/*":{"schema":{"type":"integer","format":"int64"}}}}}}},"/api/databases/with-collections":{"get":{"tags":["Database API"],"summary":"Get databases with collections","description":"Returns a map of databases and their collections","operationId":"getDatabasesWithCollections","responses":{"200":{"description":"Successfully retrieved databases with collections","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/databases/summary":{"get":{"tags":["Database API"],"summary":"Get database summary","description":"Returns a summary of all databases, collections, and document counts","operationId":"getDatabaseSummary","responses":{"200":{"description":"Successfully retrieved database summary","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"integer","format":"int64"}}}}}},"500":{"description":"Internal server error","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"integer","format":"int64"}}}}}}}}}},"components":{"schemas":{"Document":{"type":"object","properties":{"empty":{"type":"boolean"}},"additionalProperties":{"type":"object"}}},"securitySchemes":{"serviceId":{"type":"apiKey","description":"Service ID for API authentication","name":"X-Service-Id","in":"header"}}}}