Skip to content

findVersionDocument

Updated pdexter 2022-10-22

(server-side)

Retrieves a version of a document by its versionId.

Syntax

ft3.findVersionDocument(versionId, userId, function(err, document**) { **

**    ... **

})

Part Description
versionId The versionId of the document to retrieve.
userId The user id to pass. Should be ntf.user.documentId
err Error object returned from the function if it fails.
document The document object returned from the function.

Example

    ntf.logger.info('Running findVersionDocument');
    ft3.findVersionDocument('3624da40-fd08-11e7-b927-e74a925fc9ea', ntf.user.documentId, function(err, document) {
        if (err) {
            ntf.logger.error(err);
        }
        else {
            ntf.logger.info('Retrieved document version: ' + document.systemHeader.versionId); 
            ntf.logger.info('_id: ' + document._id);
        }
        callback();
    });