query_document_by_object_id {One4All}R Documentation

Query a MongoDB document by an ObjectID

Description

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

## Not run: 
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)

## End(Not run)


[Package One4All version 0.5 Index]