createDatabase: Creates a database with the specified database ID.

Description Usage Arguments Value Examples

Description

Creates a database with the specified database ID.

Usage

1
2
createDatabase(connectionInfo, newDatabaseId, consistencyLevel = "",
  sessionToken = "", userAgent = "")

Arguments

connectionInfo

A DocumentDB connection info object generated with getDocumentDBConnectionInfo().

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.

databaseId

The ID of the database to create.

Value

Some information extracted from the REST API response such as request charge and session token.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# load the documentdbr package
library(documentdbr)

# setup connection infos
myDocDB <- getDocumentDBConnectionInfo(
  accountUrl = "https://somedocumentdbaccount.documents.azure.com",
  primaryOrSecondaryKey = "t0C36UstTJ4c6vdkFyImkaoB6L1yeQidadg6wasSwmaK2s8JxFbEXQ0e3AW9KE1xQqmOn0WtOi3lxloStmSeeg=="
)

# create the MyNewDatabase database
createDatabase(myDocDB, "MyNewDatabase")

timoklimmer/documentdbr documentation built on May 31, 2019, 2:29 p.m.