getVersion

Definition

Returns the current effective version or the version that would have been current at the given date. Wrapper for getVersion.

Syntax

db.getVersion([date])

Example

ProvenDB v7754 (current)> var effdate=new Date((new Date()-(100*24*3600*1000)));
 // 100 days ago
ProvenDB v7754 (current)> db.getVersion(effdate)
{
        "ok" : 1,
        "response" : "No version for date Mon Mar 04 2019 10:58:24 GMT+1100 (AEDT)",
        "version" : null,
        "status" : "No version"
}
ProvenDB v7754 (current)> var effdate=new Date((new Date()-(7*24*3600*1000))); 
// 7 days ago
ProvenDB v7754 (current)> db.getVersion(effdate)
{
        "ok" : 1,
        "response" : "Version current at Wed Jun 05 2019 09:58:41 GMT+1000 (AEST)",
        "version" : NumberLong(7749),
        "status" : "History"
}
ProvenDB v7754 (current)> db.getVersion()
{
        "ok" : 1,
        "response" : "The version is set to: 'current'",
        "version" : NumberLong(7754),
        "status" : "current"
}

See also

getVersion