Skip to content

mongodb create-collection

Create mongodb collection

Description

Create the collection provided from the server

Synopsis

mongodb create-collection
    [--site <site>]
    <database>
    <collection>

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

database - (string)

     Name of the database
     Example: "database-1"
     Default: _None_      Attributes: required

collection - (string)

     Name of the collection
     Example: "collection-1"
     Default: _None_      Attributes: required

Examples

Input:

! mongodb create-collection "test-database-1" "test-collection-1"
Output:
Collection "test-collection-1" is created

Access Control

To use this command, you need access to the following:

Field Value
Action "create"
Service Type "mongodb"
Service Instance
Namespace
Object Type "collection"
Object ID collection

Please see Access Control for details.