getDocumentProof
Definition
Gets a blockchain proof for a specific document or set of documents. Wrapper for the getDocumentProof command.
Syntax
db.getDocumentProof(collection,filter[,version,format])
Field | Type | Mandatory | Description |
---|---|---|---|
collection | string | yes | The collection name which the document belongs to. |
filter | document | yes | The condition to filter the documents. |
version | number | no | The versions for the proof. The first version proof after the document will was created will be selected as the document proof. If not specified, then proofs for all versions of matching documents will be returned |
format | string | no | Either binary or json . Default is binary . |
Example
ProvenDB v7754 (current)> db.getDocumentProof('getDocProof1964850',{x:1})
{
"ok" : 1,
"proofs" : [
{
"collection" : "getDocProof1964850",
"version" : NumberLong(5036),
"provenDbId" : ObjectId("5cecca835f4953f13e48d458"),
"documentId" : ObjectId("5cecca835f4953f13e48d458"),
"versionProofId" : "c3d94410-810b-11e9-a57b-01d5081a0be8",
"status" : "Valid",
"btcTransaction" : "1861e7aff7ebf311790d7d099e2c62d8212fff2b7c9808c4bdd5d82ff74b9e30",
"btcBlockNumber" : "578146",
"documentHash" : "5f94b111bf44e98ee5cdb3a2b3bb21cab37757517db7a10504685191747e1b29",
"versionHash" : "854765ab7627e0b8a25620bf4c7b405b7d5fed5a15c146c13e89dfb487afb9d6",
"proof" : BinData(0,"eJysl7+OZFlS/3+/V+AZMKen ... Puv/jsAAP//fO3MoA==")
}
]
}
See also
Updated almost 5 years ago