forked from DacuTv/DocumentDBPSModule
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabout_DocumentDB.help.txt
More file actions
29 lines (21 loc) · 1.85 KB
/
about_DocumentDB.help.txt
File metadata and controls
29 lines (21 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
TOPIC
about_DocumentDB
SHORT DESCRIPTION
This module will hep with looking up DBs, Collections and to query documents in Azure DocumentDB as well as create/update them.
LONG DESCRIPTION
The purpose of this module is to provide a few simple commands to allow you to quickly query or upload/update documents in Azure DocumentDB.
It is recommended to plan how to structure your documents as at the wirting of this module Azure DocumentDB does not support field updates so instead an entire document must be senmt for each update.
The module utilises the native RestAPI
EXAMPLES
The following will list all the databases in an account:
Get-DocDBDatabases -accountName "TestDocDB" -key "23123-df233eas-34was3-aw3a3"
The following will list allt hec ollections within the specified DB:
Get-DocDBCollections -DBName "UserDetails" -accountName "TestDocDB" -key "23123-df233eas-34was3-aw3a3"
The following will pass a JSON formatted query string and return the result, this is cleaned by default to return on the necesary output, the -NoClean switch will return the raw output.
New-DocDBQuery -collection "DeletedUsers" -DBName "UserDetails" -accountName "TestDocDB" -key "23123-df233eas-34was3-aw3a3" -JSONQuery $JsonStringQuery
The following will either create a new or update an existing document depending on wether the ID already exists, you can pass a JSON formatted document (with -JSONdocument)
or a powershell object that will attempt to be converted to JSON (with -PSdocument):
Set-DocDBDocument -collection "DeletedUsers" -DBName "UserDetails" -accountName "TestDocDB" -key "23123-df233eas-34was3-aw3a3" -JSONdocument $JsonStringDocument
Set-DocDBDocument -collection "DeletedUsers" -DBName "UserDetails" -accountName "TestDocDB" -key "23123-df233eas-34was3-aw3a3" -PSdocument $PSCustomObject
KEYWORDS
DocumentDB, Collection, Database