Description Usage Arguments Value Examples
Gets a single document from a collection.
1 2 | getDocument(connectionInfo, documentId, partitionKey = "",
consistencyLevel = "", sessionToken = "", userAgent = "")
|
connectionInfo |
A DocumentDB connection info object generated with getDocumentDBConnectionInfo(). |
documentId |
The ID of the document to be queried. |
partitionKey |
Optional. The partition key value for the document to be read. Must be included if and only if the collection is created with a partitionKey definition. |
consistencyLevel |
Optional. The consistency level override. The valid values are: Strong, Bounded, Session, or Eventual (in order of strongest to weakest). The override must be the same or weaker than the account's configured consistency level. |
sessionToken |
Optional. A string token used with session level consistency. For more information, see Using consistency levels in DocumentDB. |
userAgent |
Optional. A string that specifies the client user agent performing the request. The recommended format is user agent name/version. For example, the official DocumentDB .NET SDK sets the User-Agent string to Microsoft.Document.Client/1.0.0.0. A custom user-agent could be something like ContosoMarketingApp/1.0.0. |
The result of the query as data.frame object and some information extracted from the REST API response such as request charge and session token.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # load the documentdbr package
library(documentdbr)
# get a DocumentDBConnectionInfo object
myCollection <- getDocumentDBConnectionInfo(
accountUrl = "https://somedocumentdbaccount.documents.azure.com",
primaryOrSecondaryKey = "t0C36UstTJ4c6vdkFyImkaoB6L1yeQidadg6wasSwmaK2s8JxFbEXQ0e3AW9KE1xQqmOn0WtOi3lxloStmSeeg==",
databaseId = "MyDatabaseId",
collectionId = "MyCollectionId"
)
# get a single document with a specific id and print some infos about it
getResult <- getDocument(myCollection, documentId = "3c7718ab-858b-4f42-bf5a-e2d79d2156de")
str(getResult$document)
print(getResult$document)
# print request charge
print(getResult$requestCharge)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.