Get-VEMDBCollection

Short Description

Returns backed-up MongoDB collections.

Product: Veeam Backup & Replication

Product Edition: Enterprise Plus, Veeam Universal License

Syntax

This cmdlet provides the following parameter sets:

  • ReceivingByDatabase

    Get-VEMDBCollection [-Database] <VEMDBDatabase> [-Name <String[]>] [<CommonParameters>]

  • ReceivingBySession

    Get-VEMDBCollection [-Session] <VEMDBRestoreSession> [-Name <String[]>] [<CommonParameters>]

Detailed Description

This cmdlet returns an array of backed-up MongoDB collections. After you get the backed-up collections, you can use the New-VEMDBCollectionRestoreOptionsDefines the restore options that you can apply to a restore job. cmdlet to specify the required restore options.

Parameters

Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

Database

Specifies the MongoDB database on which the collections reside.

Accepts the VEMDBDatabase object. To get this object, run the Get-VEMDBDatabaseReturns backed-up MongoDB databases. cmdlet.

VEMDBDatabase

True

0

True (ByValue)

Name

Specifies an array of names of MongoDB collections. The cmdlet will return an array of collections located on the restore point or the specified database.

This parameter accepts wildcard characters.

String[]

False

Named

False

Session

Specifies a restore session initiated to perform operations with MongoDB data.

Accepts the VEMDBRestoreSession object. To get this object, run the Get-VEMDBRestoreSessionReturns active restore sessions started to perform restore operations with backed-up MongoDB data. cmdlet.

VEMDBRestoreSession

True

0

True (ByValue)

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About Common Parameters section of Microsoft Learn.

Output Object

The cmdlet returns the VEMDBCollection[] array that contains backed-up MongoDB collections.

Examples

Get-VEMDBCollectionExample 1. Getting All MongoDB Collections Within Specified Restore Session

This example shows how to get an array of all MongoDB collections within the specified restore session.

$session = Get-VEMDBRestoreSession

$collections = Get-VEMDBCollection -Session $session[1]

Perform the following steps:

  1. Run the Get-VEMDBRestoreSessionReturns active restore sessions started to perform restore operations with backed-up MongoDB data. cmdlet. Save the result to the $session variable.

    The cmdlet will return an array of active restore sessions. Note the ordinal number of the necessary restore session (in this example, it is the second restore session in the array).

  2. Run the Get-VEMDBCollection cmdlet. Set the $session variable as the Session parameter value and select the necessary restore session. Save the result to the $collections variable to be able to use it with other cmdlets.

Get-VEMDBCollectionExample 2. Getting MongoDB Collections with Specified Names

This example shows how to get an array of MongoDB collections with the specified names.

$session = Get-VEMDBRestoreSession

$collectionnames = @("location1", "location2")

$collections = Get-VEMDBCollection -Session $session[1] -Name $collectionnames

Perform the following steps:

  1. Run the Get-VEMDBRestoreSessionReturns active restore sessions started to perform restore operations with backed-up MongoDB data. cmdlet. Save the result to the $session variable.

    The cmdlet will return an array of active restore sessions. Note the ordinal number of the necessary restore session. In this example, it is the second restore session in the array.

  2. Declare the $collectionnames variable. Assign to this variable an array with the names of the necessary MongoDB collections.
  3. Run the Get-VEMDBCollection cmdlet. Set the $session variable as the Session parameter value and specify the necessary restore session. Set the $collectionnames variable as the Name parameter value. Save the result to the $collections variable to be able to use it with other cmdlets.

Get-VEMDBCollectionExample 3. Getting MongoDB Collections from Database

This example shows how to get an array of MongoDB collections from a specific database.

$session = Get-VEMDBRestoreSession

$databases = Get-VEMDBDatabase -Session $session[0]

$collections = Get-VEMDBCollection -Database $databases[0]

Perform the following steps:

  1. Run the Get-VEMDBRestoreSessionReturns active restore sessions started to perform restore operations with backed-up MongoDB data. cmdlet. Save the result to the $session variable.

    The cmdlet will return an array of active restore sessions. Note the ordinal number of the necessary restore session (in this example, it is the first restore session in the array).

  2. Run the Get-VEMDBDatabaseReturns backed-up MongoDB databases. cmdlet. Set the $session variable as the Session parameter value and select the necessary restore session. Save the result to the $databases variable to be able to use it with other cmdlets.
  3. Run the Get-VEMDBCollection cmdlet. Set the $databases variable as the Database parameter value and select the necessary database. Save the result to the $collections variable to be able to use it with other cmdlets.

Page updated 2026-08-20

Page content applies to build 13.1.1.18