Section 1

Preview this deck

Mongoose

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

7 years ago

Date created

Mar 1, 2020

Cards (15)

Section 1

(15 cards)

Mongoose

Front

Mongoose is a MongoDB object modeling tool that you use to help model your data by using schemas and then creating models out of them.

Back

JWT

Front

JSON Web Token is an open standard that defines a way for transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed.

Back

SchemaTypes

Front

String Number Date Buffer Boolean Mixed ObjectID Array Devimal128 Map

Back

Mongoose Validators

Front

All SchemaTypes have built-in required validator which uses the checkRequired() function to see if the value satisfies the required validator. Numbers have min and max validators. Strings have enum, match, minlength, and maxlength validators.

Back

Hashing

Front

Hashing takes a value and creates a hash value out of that value which is a unique set of characters that means the same thing as the initial value but more secure const {SHA256} = require('crypto-js'); // const jwt = require('jsonwebtoken'); // const bcrypt = require('bcryptjs'); let password = '123abc!'; bcrypt.genSalt(10, (err, salt) => { bcrypt.hash(password, salt, (err, hash) => { console.log(hash); }) }) let hashedPassword = "$2a$10$Wm53cIgvpkF.q431oJ3RvO4TDJ.CHiwHn46XAyyTl/W0at98EL1NG"; bcrypt.compare(password, hashedPassword, (err, res) => { console.log(res); });

Back

Mongoose Defaults

Front

Default Value Set to Something ex completed: false

Back

Mocha

Front

A JavaScript Testing Framework Running on Node.JS Simplifies asynchronous testing

Back

Supertest

Front

Supertest is a library made specifically for testing nodejs http servers. SuperTest offers a very simple way to test APIs with just few lines of commands and well documented doc

Back

Express End Points

Front

Get and Post callback functions that behave like middleware to handle a request app.get('/example/a', function (req, res) { res.send('Hello from A!') })

Back

Postman

Front

A tool that lets you build apis to communicate with your database

Back

Mongoose.Schema

Front

Everything in Mongoose starts with a Schema. Each schema maps to a MongoDB collection and defines the shape of the documents within that collection.

Back

Headers in a browser

Front

x-auth content-type

Back

CORS

Front

Cross-Origin Resource Sharing uses additional HTTP headers to tell a browser to let a web application running at one origin (domain) have permission to access selected resources from a server at a different origin. A web application makes a cross-origin HTTP request when it requests a resource that has a different origin (domain, protocol, and port) than its own origin.

Back

Express Routing

Front

Routing refers to how an application's endpoints (URIs) respond to client requests.

Back

Authentication

Front

Authentication is for identifying users and provide different access rights and content depending on their id. In most cases the application provides a login form with certain credentials to verify a user. JWT, and Bcrypt are in authenticating

Back