Skip to contents

This function queries a mongodb database using its API to retrieve a document by its ObjectID. Use the MongoDB Atlas Data API to create an API key.

Usage

query_document_by_object_id(apiKey, collection, database, dataSource, objectId)

Arguments

apiKey

The API key for accessing the MongoDB API.

collection

The name of the collection in the MongoDB database.

database

The name of the MongoDB database.

dataSource

The data source in MongoDB.

objectId

The object ID of the document to query.

Value

The queried document.

Examples

if (FALSE) { # \dontrun{
apiKey <- 'your_mongodb_api_key'
collection <- 'your_mongodb_collection'
database <- 'your_database'
dataSource <- 'your_dataSource'
objectId <- 'example_object_id'
query_document_by_object_id(apiKey, collection, database, dataSource, objectId)
} # }