Angular Cheat Sheet. Contribute to delprzemo/angular-cheatsheet development by creating an account on GitHub. Angular is a platform for building mobile and desktop web applications. Join the community of millions of developers who build compelling user interfaces with Angular. Angular 8/9 Event List CheatSheet. GitHub Gist: instantly share code, notes, and snippets.
Angular 8 Cheat Sheets
This is an article on advanced queries in Amazon DynamoDB and it builds upon DynamoDB basic queries.
(This tutorial is part of our DynamoDB Guide. Use the right-hand menu to navigate.)
DynamoDB Query Rules
Remember the basic rules for querying in DynamoDB:
- The query includes a key condition and filter expression.
- The key condition selects the partition key and, optionally, a sort key.
- The partition key query can only be equals to (=). Thus, if you want a compound primary key, then add a sort key so you can use other operators than strict equality.
- Having selected a subset of the database with the key condition, you can narrow that down by writing a filter expression. That can run against any attribute.
- Logical operators (>, <, begins_with, etc.) are the same for key conditions and filter expressions, except you cannot use contains as a key condition.
Load sample data
To perform these advanced queries, we need some data to work with. Download this sample data from GitHub, which is data from IMDB that I’ve slightly modified.
Create a table
In this document we are using DynamoDB on a local machine. So, we specify –endpoint-urlhttp://localhost:8000.
Create the title table like this:
Notice that the primary key is the combination of the attributes tconst (partition key) and primaryTitle (sort key).
For our sample data we have data like shown below. All the partition keys are set to the same value movie. Then the movie primaryTitle is the sort key.
Then load the data like this:
Between query
Here we use the first (space) and last (ÿ) characters in the UTF-8 character set to select all titles.
Begins with query
Contains query
Here we write a filter expression instead of a key condition just to show how to write a filter expression as opposed to a key condition. As we mentioned above, the operators are the same, except you cannot use the operator contains as a key condition.
Attribute exists query
Attribute not exists query
In query
String set query
Our data contains data like this:
So, an equality condition on that string set (SS) element would necessarily contain all those strings.
Boolean query
Angular 8 Cheat Sheet
Boolean data is stored like this:
So, you query it like this:
Query map type
The map query is similar to the nested query (see the next item).
Nested query
A nested DynamoDB object is one that contains a map. You refer to the element using the dot notation parent.child, like for this data you would write aditionalInfo.Location.
Location is a reserved word, so we have to give it an alias using:
And here is the nested DynamoDB query:
Projection Expression
Use this projection expression to limit the attributes returned by DynamoDB, as it returns all attributes by default.
Additional resources
For more on this topic, explore the BMC Big Data & Machine Learning Blog or check out these resources:
- AWS Guide, with 15+ articles and tutorials on AWS
Angular 8 Cheat Sheet For Beginners
Find below quick step by step instructions on how to debug Angular applications with Visual Studio Code.
Contents
- Tested on Visual Studio Code v1.52.1 on CentOS 7 (more recent versions do not work on CentOS 7)
- Ctrl-Shift+` & Create JavaScript Debug Terminal
npm run test
or:ng serve --port=8080
with F5 + Launch Chrome- set breakpoints (left of the line numbers of the code editor)
- Navigate through the code:
- F10: Step Over
- F11: Step Into
- Shift+F11: Step Out
- F5: Continue
- Menu –> Terminal –> New Terminal (Shortcut: Ctrl-Shift+`)
- on drop down menu in the terminal tab (showing
1: sh
or1: bash
or1: cmd
):
–> Create JavaScript Debug Terminal
- In the debug terminal:
npm run test
–> the debugger automatically connects to the application
Alternatively start the Angular application and debug it via Chrome:
ng serve --port=8080
Port8080
is the default port used in the Chrome debugger config below; however, you can edit it via Menu -> Run -> Open Configurations to match theng serve
default of4200
- wait until you see „: Compiled successfully.“
- Menu –> Run –> Start Debugging (Shortcut: F5)
- –> Chrome
- A browser opens on localhost:8080
- Use the application as appropriate
- Breakpoints can be set in the code left of the editor (a non-solid white on black or a solid red circle appears)
or
–> once the application hits the breakpoint, the debugger waits for additional instructions to navigate through the code.
- Debugging Shortcuts