Home > git-documentdb > Collection > getHistory
Collection.getHistory() method#
Get revision history of a JSON document
Signature:Parameters#
| Parameter | Type | Description |
|---|---|---|
| _id | string | |
| historyOptions | HistoryOptions | The array of revisions is filtered by HistoryOptions.filter. |
Promise<(JsonDoc | undefined)[]>
Array of JsonDoc or undefined if a specified document does not exist or it is deleted.
Remarks#
By default, revisions are sorted by reverse chronological order. However, keep in mind that Git dates may not be consistent across repositories.
If serializeFormat is front-matter, this function can't work for .yml files. Use getFatDocHistory() instead. e.g.) foo.yml