Cmdlets for MongoDB

Build 24.0.9060

Getting Started

Connecting to MongoDB

Establishing a Connection shows how to authenticate to MongoDB and configure any necessary connection properties. You can also configure cmdlet capabilities through the available Connection properties, from data modeling to firewall traversal. The Advanced Settings section shows how to set up more advanced configurations and troubleshoot connection errors.

Connecting from PowerShell

The CData Cmdlets PowerShell Module for MongoDB provides a familiar way to interact with MongoDB from PowerShell. The cmdlets provide a standard PowerShell interface and an SQL interface to live data. The CData cmdlets enable you to work with MongoDB using standard PowerShell objects; you can chain the cmdlets to each other or other cmdlets in pipelines. The cmdlets also support PowerShell debug streams.

Data Manipulation with Cmdlets

See Establishing a Connection to learn how to get started with the Connect-MongoDB cmdlet. You can then pass the MongoDBConnection object returned to other cmdlets for accessing data:

  • Select-MongoDB
  • Add-MongoDB
  • Update-MongoDB
  • Remove-MongoDB

Executing SQL from PowerShell

You can execute any SQL query with the Invoke-MongoDB cmdlet.

Accessing Debug Output from Streams

See Capturing Errors and Logging to obtain the debug output through PowerShell streams.

PowerShell Version Support

The standard cmdlets are supported in PowerShell 2, 3, 4, and 5.

MongoDB Version Support

The cmdlet models MongoDB instances as relational databases and supports MongoDB versions 2.6 through 7.0. The cmdlet leverages the MongoDB API, including the MongoDB aggregation framework, to enable bidirectional SQL access to MongoDB data. See the NoSQL Database chapter for SQL-to-MongoDB query mappings and more information about accessing unstructured data in MongoDB through SQL. See the DBaaS Connections page to connect to popular services such as Atlas and ObjectRocket.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060