This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// referencia a la clase pokemon | |
// https://gist.github.com/konami12/2359d276454cdcb81d291597a042e375 | |
/* | |
Para poder implementar el polimorfismo iniciaremos | |
aplicando el principio de herencia. | |
*/ | |
class TypeFire extends Pokemon { | |
constructor(name, evolutions) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// referencia a la clase pokemon https://gist.github.com/konami12/2359d276454cdcb81d291597a042e375 | |
/* | |
Para poder implementar el principio de "Herencia" se utiliza | |
la palabra reservada "extends" seguida del nombre del | |
objeto padre (Super Class) el cual seria "Pokemon". | |
*/ | |
class TypeFire extends Pokemon { | |
constructor(name, evolutions) { | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Como primer ejemplo los datos se conseguiran de un | |
"JSON" el cual funciona como una Base de Datos. | |
*/ | |
import Data from "./infoPokemons.json"; | |
class Pokedex { | |
/* | |
Se crea el método para conseguir la información de un | |
"Pokémon". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pokemon { | |
/* | |
Gracias a las nuevas especificaciones de JavaScript podemos | |
utilizar el "#" para indicar que un atributo o método es privado, | |
evitando el acceso desde fuera de la clase. | |
*/ | |
#name = ""; | |
#type = "" | |
#evolutions = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Para definir una clase en JavaScript se utiliza | |
la palabra reservada "class" seguida del nombre | |
de la clase a crear, Como buena práctica el nombre | |
de la clase inicia con mayúsculas y tenga el estilo | |
"CanelCase". | |
*/ | |
class Pokemon { | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// importando dependencias | |
const Express = require("express"); | |
const { connect } = require("mongoose"); | |
// llamando al | |
const { agenda } = require("./schema.js"); | |
const FakeData = require("./fakeData.json"); | |
const Server = Express(); | |
// Parametros de conexion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"names": [ | |
"Jorge", | |
"Dante", | |
"Raquel", | |
"Evaristo", | |
"Santiago" | |
], | |
"lastNames": [ | |
"Méndez", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//importamos las dependencia mongoose | |
const { Schema, model } = require("mongoose"); | |
// Segenera el esquema base | |
const SCHEMA = new Schema({ | |
name: { type: String, require: true }, | |
lastName: String, | |
age: Number, | |
random: Number, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "mongodb-atlas", | |
"version": "1.0.0", | |
"description": "Practica de conexion", | |
"main": "src/index.js", | |
"scripts": { | |
"start": "nodemon ./" | |
}, | |
"dependencies": { | |
"express": "4.17.1", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |