< Back

Get-CouchDBDocument

Sun Jan 19, 2020 6:30 pm

NAME Get-CouchDBDocument



SYNOPSIS

Get a document.





SYNTAX

Get-CouchDBDocument [-Server <String>] [-Port <Int32>] [-Database <String>] [-Document <String>] [-Revision

<String>] [-Local] [-Revisions] [-History] [-Attachments] [-AttachmentsInfo] [-AttachmentsSince <Array>]

[-Conflicts] [-DeletedConflicts] [-Latest] [-LocalSequence] [-Metadata] [-OpenRevisions <Array>] [-Descending]

[-EndKey <String>] [-EndKeyDocument <String>] [-Group] [-GroupLevel <Int32>] [-IncludeDocuments] [-InclusiveEnd

<Boolean>] [-Key <Object>] [-Keys <Array>] [-Limit <Int32>] [-Reduce <Boolean>] [-Skip <Int32>] [-Sorted

<Boolean>] [-Stable] [-Stale <String>] [-StartKey <String>] [-StartKeyDocument <String>] [-Update <String>]

[-UpdateSequence] [-Authorization <String>] [-Ssl] [<CommonParameters>]



Get-CouchDBDocument [-Server <String>] [-Port <Int32>] [-Database <String>] [-Document <String>] [-Revision

<String>] [-Info] [-Local] [-Authorization <String>] [-Ssl] [<CommonParameters>]





DESCRIPTION

Get a CouchDB document json data.

Executes the built-in _all_docs view, returning all of the documents in the database.





PARAMETERS

-Server <String>

The CouchDB server name. Default is localhost.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Port <Int32>

The CouchDB server port. Default is 5984.



Required? false

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-Database <String>

The CouchDB database.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Document <String>

The CouchDB document. Default is _all_docs.



Required? false

Position? named

Default value _all_docs

Accept pipeline input? false

Accept wildcard characters? false



-Revision <String>

The CouchDB revision document.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Info [<SwitchParameter>]

Return CouchDB header info of document.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Local [<SwitchParameter>]

Return CouchDB local document.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Revisions [<SwitchParameter>]

Return all CouchDB db revisions.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-History [<SwitchParameter>]

Return all info CouchDB db revisions.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Attachments [<SwitchParameter>]

Includes attachments bodies in response.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-AttachmentsInfo [<SwitchParameter>]

Includes encoding information in attachment stubs if the particular attachment is compressed.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-AttachmentsSince <Array>

Includes attachments only since specified revisions. Doesn??????????????????t includes attachments for specified revisions.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Conflicts [<SwitchParameter>]

Includes information about conflicts in document.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-DeletedConflicts [<SwitchParameter>]

Includes information about deleted conflicted revisions.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Latest [<SwitchParameter>]

Forces retrieving latest ????????????????leaf??????????????? revision, no matter what rev was requested.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-LocalSequence [<SwitchParameter>]

Includes last update sequence for the document.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Metadata [<SwitchParameter>]

Acts same as specifying all conflicts, deleted_conflicts and revs_info query parameters.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-OpenRevisions <Array>

Retrieves documents of specified leaf revisions. Additionally, value all id default and to return all leaf

revisions.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Descending [<SwitchParameter>]

Return the design documents in descending by key order. Default is false. The document must be _all_docs.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-EndKey <String>

Stop returning records when the specified key is reached. The document must be _all_docs.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-EndKeyDocument <String>

Stop returning records when the specified document ID is reached. Ignored if endkey is not set. The document

must be _all_docs.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Group [<SwitchParameter>]

Group the results using the reduce function to a group or single row. Implies reduce is true and the maximum

group_level. Default is false. The document must be _all_docs.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-GroupLevel <Int32>

Specify the group level to be used. Implies group is true. The document must be _all_docs.



Required? false

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-IncludeDocuments [<SwitchParameter>]

Include the associated document with each row. Default is false. The document must be _all_docs.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-InclusiveEnd <Boolean>

Specifies whether the specified end key should be included in the result. Default is true. The document must

be _all_docs.



Required? false

Position? named

Default value True

Accept pipeline input? false

Accept wildcard characters? false



-Key <Object>

Return only documents that match the specified key. The document must be _all_docs.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Keys <Array>

Return only documents where the key matches one of the keys specified in the array. The document must be

_all_docs.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Limit <Int32>

Limit the number of the returned design documents to the specified number. The document must be _all_docs.



Required? false

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-Reduce <Boolean>

Use the reduction function. Default is true when a reduce function is defined. The document must be _all_docs.



Required? false

Position? named

Default value True

Accept pipeline input? false

Accept wildcard characters? false



-Skip <Int32>

Skip this number of records before starting to return the results. Default is 0. The document must be

_all_docs.



Required? false

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-Sorted <Boolean>

Sort returned rows. Setting this to false offers a performance boost.

The total_rows and offset fields are not available when this is set to false. Default is true. The document

must be _all_docs.



Required? false

Position? named

Default value True

Accept pipeline input? false

Accept wildcard characters? false



-Stable [<SwitchParameter>]

Whether or not the view results should be returned from a stable set of shards. Default is false. The document

must be _all_docs.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Stale <String>

Allow the results from a stale view to be used. Supported values: ok, update_after and false. ok is equivalent

to stable=true&update=false.

update_after is equivalent to stable=true&update=lazy. false is equivalent to stable=false&update=true. The

document must be _all_docs.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-StartKey <String>

Return records starting with the specified key. The document must be _all_docs.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-StartKeyDocument <String>

Return records starting with the specified document ID. Ignored if startkey is not set. The document must be

_all_docs.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Update <String>

Whether or not the view in question should be updated prior to responding to the user. Supported values: true,

false, lazy. Default is true. The document must be _all_docs.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-UpdateSequence [<SwitchParameter>]

Whether to include in the response an update_seq value indicating the sequence id of the database the view

reflects. Default is false. The document must be _all_docs.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Authorization <String>

The CouchDB authorization form; user and password.

Authorization format like this: user:password

ATTENTION: if the password is not specified, it will be prompted.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Ssl [<SwitchParameter>]

Set ssl connection on CouchDB server.

This modify protocol to https and port to 6984.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





CouchDB API:

GET /{db}/_local_docs

GET /{db}/_all_docs

GET /{db}/{docid}

HEAD /{db}/_local_docs

HEAD /{db}/_all_docs

HEAD /{db}/{docid}



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-CouchDBDocument -Database test -Document "Hitchhikers"



This example get document "Hitchhikers" on database "test".









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-CouchDBDocument -Database test



This example get all documents on database "test".









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Get-CouchDBDocument -Database test -Revisions



This example get all revision on database "test".









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>if (Get-CouchDBDocument -Database test -Document "Hitchhikers" -Info) { echo doc exists! }



Test if document "Hitchhikers" on database "test" exists.











RELATED LINKS

https://pscouchdb.readthedocs.io/en/lat ... a-document