Home > git-documentdb > Collection > getOldRevision
Collection.getOldRevision() method#
Get an old revision of a JSON document
Signature:Parameters#
| Parameter | Type | Description |
|---|---|---|
| shortId | string | shortId is a file path whose collectionPath and extension are omitted. |
| revision | number | Specify a number to go back to old revision. Default is 0. See Collection.getHistory() for the array of revisions. |
| historyOptions | HistoryOptions | The array of revisions is filtered by HistoryOptions.filter. |
Promise<JsonDoc | undefined>
Remarks#
undefined if a specified document does not exist or it is deleted.
If serializeFormat is front-matter, this function can't correctly distinguish files that has the same _id but different extension. Use getFatDocOldRevision() instead. e.g.) foo.md and foo.yml