Skip to main content

Retrieve a collection

Learn how to retrieve a collection.

During development, you may need to change Vault collections to store new properties, remove properties that are no longer needed, or update properties’ attributes. You may need to know what properties are in the collection to construct queries or add objects.

You get the details of a collection using the REST API or CLI. The collection schema includes information such as the collection name, type, a list of properties, and metadata such as creation and modification time. The metadata includes built-in properties that are added as part of the schema prototype.

Get a collection schema

Overview

The steps you take to get the collection are:

  1. Determine the collection you want to retrieve.
  2. Use the CLI get a collection command or the REST API get collection operation, passing the collection name and type of output required.

Step-by-step

You want to get the details of the ‘buyers’ collection you created in Create a collection.

You have two choices of how the collection details are presented:

  • PVschema
  • JSON
Get the collection with PVschema output

With the CLI, run this command:

pvault collection get --collection buyers

You get a response similar to this:

buyers PERSONS (
address ADDRESS,
email EMAIL UNIQUE,
name NAME,
phone_number PHONE_NUMBER NULL
);
Get the collection with JSON format output

To get the collection details in JSON format, with the CLI, run this command:

pvault collection get --collection buyers --json

You get a response similar to this:

{
"creation_time": "2022-07-16T16:28:37.182702796Z",
"modification_time": "2022-07-16T16:28:37.182702796Z",
"name": "buyers",
"properties": [
{
"creation_time": "2022-07-16T16:28:37.182702796Z",
"description": "",
"is_builtin": false,
"is_encrypted": true,
"is_index": false,
"is_nullable": false,
"is_readonly": false,
"is_unique": false,
"modification_time": "2022-07-16T16:28:37.182702796Z",
"name": "address",
"pii_type_name": "ADDRESS"
},
{
"creation_time": "2022-07-16T16:28:37.182702796Z",
"description": "",
"is_builtin": false,
"is_encrypted": true,
"is_index": false,
"is_nullable": false,
"is_readonly": false,
"is_unique": true,
"modification_time": "2022-07-16T16:28:37.182702796Z",
"name": "email",
"pii_type_name": "EMAIL"
},
{
"creation_time": "2022-07-16T16:28:37.182702796Z",
"description": "",
"is_builtin": false,
"is_encrypted": true,
"is_index": false,
"is_nullable": false,
"is_readonly": false,
"is_unique": false,
"modification_time": "2022-07-16T16:28:37.182702796Z",
"name": "name",
"pii_type_name": "NAME"
},
{
"creation_time": "2022-07-16T16:28:37.182702796Z",
"description": "",
"is_builtin": false,
"is_encrypted": true,
"is_index": false,
"is_nullable": true,
"is_readonly": false,
"is_unique": false,
"modification_time": "2022-07-16T16:28:37.182702796Z",
"name": "phone_number",
"pii_type_name": "PHONE_NUMBER"
}
],
"type": "PERSONS"
}