{ "ModelName": "Movies", "ModelMetadata": { "Author": "Rafal Wilinski", "DateCreated": "2022-01-08T11:21:37.563Z", "DateLastModified": "2022-01-08T11:21:37.563Z", "Description": "Movies and their actors and directors", "AWSService": "Amazon DynamoDB", "Version": "2.0" }, "DataModel": [ { "TableName": "data", "KeyAttributes": { "PartitionKey": { "AttributeName": "PK", "AttributeType": "S" }, "SortKey": { "AttributeName": "SK", "AttributeType": "S" } }, "NonKeyAttributes": [ { "AttributeName": "type", "AttributeType": "S" }, { "AttributeName": "__id", "AttributeType": "S" }, { "AttributeName": "year", "AttributeType": "N" }, { "AttributeName": "budget", "AttributeType": "S" }, { "AttributeName": "boxOffice", "AttributeType": "S" }, { "AttributeName": "category", "AttributeType": "S" }, { "AttributeName": "gsi2pk", "AttributeType": "S" }, { "AttributeName": "gsi2sk", "AttributeType": "S" }, { "AttributeName": "role", "AttributeType": "S" }, { "AttributeName": "playedBy", "AttributeType": "S" }, { "AttributeName": "name", "AttributeType": "S" }, { "AttributeName": "nationality", "AttributeType": "S" }, { "AttributeName": "gsi1pk", "AttributeType": "S" }, { "AttributeName": "gsi1sk", "AttributeType": "S" }, { "AttributeName": "alias", "AttributeType": "S" } ], "GlobalSecondaryIndexes": [ { "IndexName": "gsi1", "KeyAttributes": { "PartitionKey": { "AttributeName": "gsi1pk", "AttributeType": "S" }, "SortKey": { "AttributeName": "gsi1sk", "AttributeType": "S" } }, "Projection": { "ProjectionType": "ALL" } }, { "IndexName": "gsi2", "KeyAttributes": { "PartitionKey": { "AttributeName": "gsi2pk", "AttributeType": "S" }, "SortKey": { "AttributeName": "gsi2sk", "AttributeType": "S" } }, "Projection": { "ProjectionType": "ALL" } } ], "TableData": [ { "type": { "S": "movie" }, "pk": { "S": "MOVIE#DieHard" }, "sk": { "S": "MOVIE#DieHard" }, "__id": {}, "year": { "N": "1988" }, "budget": { "S": "25-35MM" }, "boxOffice": { "S": "140MM" }, "category": { "S": "Action" }, "gsi2pk": { "S": "Action" }, "gsi2sk": { "S": "1988" } }, { "type": { "S": "character" }, "pk": { "S": "MOVIE#DieHard" }, "sk": { "S": "CHARACTER#JohnMcClane" }, "__id": {}, "role": { "S": "protagonist" }, "playedBy": { "S": "Bruce Willis" }, "name": { "S": "John McClane" }, "nationality": { "S": "Irish-American" }, "gsi1pk": { "S": "CHARACTER#JohnMcClane" }, "gsi1sk": { "S": "MOVIE#DieHard" } }, { "type": { "S": "director" }, "pk": { "S": "MOVIE#DieHard" }, "sk": { "S": "DIRECTOR#JohnMcTiernan" }, "__id": {}, "name": { "S": "John McTiernan" }, "gsi1pk": { "S": "DIRECTOR#JohnMcTiernan" }, "gsi1sk": { "S": "MOVIE#DieHard" } }, { "type": { "S": "character" }, "pk": { "S": "MOVIE#DieHard" }, "sk": { "S": "CHARACTER#HansGruber" }, "role": { "S": "antagonist" }, "playedBy": { "S": "Alan Rickman" }, "name": { "S": "Hans Gruber" }, "alias": { "S": "Bill Clay" }, "nationality": { "S": "German" }, "__id": {} }, { "type": { "S": "movie" }, "pk": { "S": "MOVIE#DieHard2" }, "sk": { "S": "MOVIE#DieHard2" }, "year": { "N": "1990" }, "budget": { "S": "62–70MM" }, "boxOffice": { "S": "240MM" }, "category": { "S": "Action" }, "__id": {}, "gsi2pk": { "S": "Action" }, "gsi2sk": { "S": "1990" } }, { "type": { "S": "character" }, "pk": { "S": "MOVIE#DieHard2" }, "sk": { "S": "CHARACTER#JohnMcClane" }, "__id": {}, "role": { "S": "protagonist" }, "playedBy": { "S": "Bruce Willis" }, "nationality": { "S": "Irish-American" }, "name": { "S": "John McClane" }, "gsi1pk": { "S": "CHARACTER#JohnMcClane" }, "gsi1sk": { "S": "MOVIE#DieHard2" } }, { "type": { "S": "director" }, "pk": { "S": "MOVIE#DieHard2" }, "sk": { "S": "DIRECTOR#RennyHarlin" }, "name": { "S": "Renny Harlin" }, "gsi1pk": { "S": "DIRECTOR#RennyHarlin" }, "gsi1sk": { "S": "MOVIE#DieHard2" }, "__id": {} } ], "ModelSchema": { "indexes": { "primary": { "hash": "pk", "sort": "sk" }, "gsi1": { "hash": "gsi1pk", "sort": "gsi1sk", "projection": "ALL" }, "gsi2": { "hash": "gsi2pk", "sort": "gsi2sk", "projection": "ALL" } }, "models": { "movie": { "type": { "type": "string", "value": "movie" }, "pk": { "type": "string" }, "sk": { "type": "string" }, "year": { "type": "number" }, "budget": { "type": "string" }, "boxOffice": { "type": "string" }, "category": { "type": "string" }, "__id": {}, "gsi2pk": { "type": "string", "value": "${category}" }, "gsi2sk": { "type": "string", "value": "${year}" } }, "character": { "type": { "type": "string", "value": "character" }, "pk": { "type": "string" }, "sk": { "type": "string" }, "__id": {}, "role": { "type": "string" }, "playedBy": { "type": "string" }, "nationality": { "type": "string" }, "name": { "type": "string" }, "gsi1pk": { "type": "string" }, "gsi1sk": { "type": "string" } }, "director": { "type": { "type": "string", "value": "director" }, "pk": { "type": "string" }, "sk": { "type": "string" }, "name": { "type": "string" }, "gsi1pk": { "type": "string", "value": "${sk}" }, "gsi1sk": { "type": "string", "value": "${pk}" }, "__id": {} } }, "version": "0.1.0", "params": { "typeField": "type" }, "format": "onetable:1.0.0", "queries": { "Die Hard Characters": { "hash": "MOVIE#DieHard", "sort": "CHARACTER#", "limit": "100", "index": "primary", "schema": "Current", "type": "Query", "operation": "Begins with", "filters": [] }, "Movies by John McTiernan": { "hash": "DIRECTOR#JohnMcTiernan", "sort": "MOVIE#", "limit": "100", "index": "gsi1", "schema": "Current", "type": "Query", "operation": "Begins with", "filters": [] }, "Get Die Hard 2 Director": { "hash": "MOVIE#DieHard2", "sort": "DIRECTOR#", "limit": "100", "index": "primary", "schema": "Current", "type": "Query", "operation": "Begins with", "filters": [] }, "Action Movies before 1989": { "hash": "Action", "sort": "1989", "limit": "100", "index": "gsi2", "schema": "Current", "type": "Query", "operation": "Less than", "filters": [] }, "Movies where John McClane was a protagonist": { "hash": "CHARACTER#JohnMcClane", "sort": "MOVIE#", "limit": "100", "index": "gsi1", "schema": "Current", "type": "Query", "operation": "Begins with", "filters": [ { "operation": "Equal", "combine": "And", "field": "role", "value": "protagonist", "type": "string" } ] }, "Details about Die Hard": { "hash": "MOVIE#DieHard", "sort": "MOVIE#DieHard", "limit": "100", "index": "primary", "schema": "Current", "type": "Query", "operation": "Equal", "filters": [] }, "All Action Movies": { "hash": "Action", "sort": "", "limit": "100", "index": "gsi2", "schema": "Current", "type": "Query", "operation": "Begins with", "filters": [] } } } } ], "ModelSchema": { "indexes": { "primary": { "hash": "pk", "sort": "sk" }, "gsi1": { "hash": "gsi1pk", "sort": "gsi1sk", "projection": "ALL" }, "gsi2": { "hash": "gsi2pk", "sort": "gsi2sk", "projection": "ALL" } }, "models": { "movie": { "type": { "type": "string", "value": "movie" }, "pk": { "type": "string" }, "sk": { "type": "string" }, "year": { "type": "number" }, "budget": { "type": "string" }, "boxOffice": { "type": "string" }, "category": { "type": "string" }, "__id": {}, "gsi2pk": { "type": "string", "value": "${category}" }, "gsi2sk": { "type": "string", "value": "${year}" } }, "character": { "type": { "type": "string", "value": "character" }, "pk": { "type": "string" }, "sk": { "type": "string" }, "__id": {}, "role": { "type": "string" }, "playedBy": { "type": "string" }, "nationality": { "type": "string" }, "name": { "type": "string" }, "gsi1pk": { "type": "string" }, "gsi1sk": { "type": "string" } }, "director": { "type": { "type": "string", "value": "director" }, "pk": { "type": "string" }, "sk": { "type": "string" }, "name": { "type": "string" }, "gsi1pk": { "type": "string", "value": "${sk}" }, "gsi1sk": { "type": "string", "value": "${pk}" }, "__id": {} } }, "version": "0.1.0", "params": { "typeField": "type" }, "format": "onetable:1.0.0", "queries": { "Die Hard Characters": { "hash": "MOVIE#DieHard", "sort": "CHARACTER#", "limit": "100", "index": "primary", "schema": "Current", "type": "Query", "operation": "Begins with", "filters": [] }, "Movies by John McTiernan": { "hash": "DIRECTOR#JohnMcTiernan", "sort": "MOVIE#", "limit": "100", "index": "gsi1", "schema": "Current", "type": "Query", "operation": "Begins with", "filters": [] }, "Get Die Hard 2 Director": { "hash": "MOVIE#DieHard2", "sort": "DIRECTOR#", "limit": "100", "index": "primary", "schema": "Current", "type": "Query", "operation": "Begins with", "filters": [] }, "Action Movies before 1989": { "hash": "Action", "sort": "1989", "limit": "100", "index": "gsi2", "schema": "Current", "type": "Query", "operation": "Less than", "filters": [] }, "Movies where John McClane was a protagonist": { "hash": "CHARACTER#JohnMcClane", "sort": "MOVIE#", "limit": "100", "index": "gsi1", "schema": "Current", "type": "Query", "operation": "Begins with", "filters": [ { "operation": "Equal", "combine": "And", "field": "role", "value": "protagonist", "type": "string" } ] }, "Details about Die Hard": { "hash": "MOVIE#DieHard", "sort": "MOVIE#DieHard", "limit": "100", "index": "primary", "schema": "Current", "type": "Query", "operation": "Equal", "filters": [] }, "All Action Movies": { "hash": "Action", "sort": "", "limit": "100", "index": "gsi2", "schema": "Current", "type": "Query", "operation": "Begins with", "filters": [] } } } }