Aggregation framework con PyMongo

Slides:



Advertisements
Presentaciones similares
Noviembre– La lección tres. cgaisar arcasigaasar carga caracasagasasaca caigaarcascasarsacargracias.
Advertisements

-go Verbs There is a small but very important group of verbs that we call the -go verbs. These verbs are: Hacer: to make/do Poner: to put Decir: to say.
Hoy es el nueve de noviembre. VERBOS Hacer atletismo Ir en monopatín Patinar Mandar los textos.
*** 3 MINUTES *** Objective: I can write and talk about my and others family members Vocab/Ideas: Family members (review) Possessive adjectives (review)
Noviembre – La lección uno. mnioceraa ricacararima canoaamericanocariecamino camaaireamanamorarco marina.
Question words question WORDS? Cómo Cuándo Cuánto Dónde Por qué Qué Cuál Quién A qué hora Adónde.
Noviembre– La lección tres. gpeirenors grisreino signogripe peropesopeorreno serenoperrosperegrinos.
Diciembre– La lección dos. ccaesanivo vacacasa canasaca vasonavacenavena avenavacaciones.
El verbo: IR. Yo voy Nosotros/as vamos Tú vas Él/ella/ud. va Ellos/ellas/uds van.
I can… Listen and respond to questions in L2 Review concepts from Spanish 1 Recognize when to use SER or ESTAR Use SER/ESTAR in context Recognize when.
PART 1: 1 st slide – record your phone conversation. PART 2: 10 slides – see topics per slide Each slide will have an illustration / clip art that goes.
PROGRAM EVALUATION Quick and Dirty (actual versus expected) Propensity matching Identifying the best programs.
Structure Query Languaje SQL. Introducción a SQL El lenguaje de consulta estructurado (SQL) es un lenguaje de base de datos normalizado, utilizado por.
Learning activity 3 / Actividad de aprendizaje 3
April 27- May 1. Para Empezar: 27 de abril El mundo es una comedia para los que piensan y una tragedia para los que sienten. Para Empezar: 27 de abril.
Trabajo de Entrada NP36 Semana 24. Trabajo de Entrada 29/2: NP 36-Traduzca- Copy and translate. 1. Hablo.6. Enseñáis. 2. Enseña.7. Hablan. 3. Trabajamos.8.
Learning activity 3 / Actividad de aprendizaje 3
Noviembre – La Lección Uno. mlrápaas alarpalapalas palma alasalmaalmas palmarpalmasramarasparasa.
Learning activity 3 / Actividad de aprendizaje 3 Evidence: Your next holiday destination / Evidencia: Su próximo destino de vacaciones In a recording describe.
Learning activity 3 / Actividad de aprendizaje 3 Evidence: Your next holiday destination / Evidencia: Su próximo destino de vacaciones In a recording describe.
Learning activity 3 / Actividad de aprendizaje 3 Evidence: Your next holiday destination / Evidencia: Su próximo destino de vacaciones In a recording describe.
Saludos, números y abc’s
EasyChair How to submit a paper Como someter un paper
Cómo trabajar con aplicaciones de Google
“HAD BETTER” and “SHOULD”
Agendas de actuación.
Ir practice activities
Apuntes el 6 de febrero El presente progresivo
TOPIC: REVIEW OF POSSESSIVES
Structure Query Languaje
CONJUGATIONS TOP 10 IRREGULAR VERBS.
EspaÑol 1 Lesson 3 30 de Agosto de 2016
Proyecto de vocabulario de la ciudad
RCM SAE JA 1011 Evaluation Criteria for Reliability-Centered Maintenance (RCM) Processes Criterios de evaluación para los procesos de Mantenimiento Centrado.
Los adjetivos Descriptivos
Within present tense verbs there are also:
PREGUNTAS: Questions and Question Words
SQL Lenguaje de Consulta Estructurado
Base de Datos II Almacenamiento.
AGENDA Diario / Recordatorio: Prueba-Dictado #2; próximo lunes
First Grade Dual High Frequency Words
Telling time to the minute, using “y” and “menos”.
Consultas SQL.
Structure Query Languaje
Los pronombres relativos que y quien
How to Log in to RosettaStone and Install the Speech Component
EasyChair How to submit a paper Como someter un paper
APRENDIENDO LCFF & LCAP Objetivos, resultados, indicadores y acciones
Pronouns, the verb SER, Adjectives
Nuevas Características de SQL Server 2016
LOS VERBOS TENER Y VENIR
PREGUNTAS: Questions and Question Words
Classroom Phrases.
Los pronombres relativos que y quien
Hoy es lunes el 29 de febrero Today is Monday, February 29
Para hacer ahora Identifiquen:
Saquen papel y un lápiz, por favor.
Metas:  Puedo presentar información sobre mis clases, actividades y reglas. Puedo usar verbos con cambio en el radical (stem changing verbs). Enfoque:
Kindergarten Spanish High Frequency Words
Introducción a Limites Cálculo
Question Words.
Development of the concert programme
Poster project.
Final Exam: Speaking Complete the “Final Exam: Verbs for Listening and Reading Sections” Study Guide Use your notes- these are irregular verbs! You will.
Construcción de elementos de Software 4 MSc. Oscar Mauricio Salazar Ospina MSc Juan Camilo Jaramillo Alzate 15/05/2019Programación distribuida y paralela1.
Stem-Changing Verbs (a.k.a., “boot” verbs or “shoe” verbs
Astronomy has really big numbers. Distance between Earth and Sun meters kilometers This is the closest star.
This is a quick practice for the rules of rounding significant figures:  When multiplying or dividing, round to least number of sig figs.  When adding.
EXCEL INTERMEDIO FILTROS AVANZADOS – TABLA DINAMICA – AUDITORIA DE FORMULAS JORGE LUIS AGUILAR ALCALDE.
Las Preguntas (the questions) Tengo una pregunta… Sí, Juan habla mucho con el profesor en clase. No, Juan no habla mucho en clase. s vo s vo Forming.
Transcripción de la presentación:

Aggregation framework con PyMongo OBJETIVO: NUESTRO OBJETIVO ES APROVECHAR AL MÁXIMO LA INTEGRACIÓN DE UN MODELO DE BD NO RELACIONAL A NUESTRO PROYECTO COMO: Haremos uso de la libreria PYMONGO para poder trabajar fácilmente con nuestra BD NO RELACIONAL *** EN ESTE CASO ES MONGODB ***

Aggregation Framework Integrando PyMongo con tu Django App Entorno de trabajo Introducción MongoDB Aggregation Framework Integrando PyMongo con tu Django App ** QUE VAMOS A VER ENTORNO DE TRABAJO: DESCRIBIREMOS CUÁL ES LA INFRAESTRUCTURA DE NUESTRO PROYECTO VEREMOS QUE ES UN FRAMEWORK DE AGREGACIÓN YA QUE VAMOS A HACER USO DE MONGODB VEREMOS UNA PEQUEÑA INTRODUCCIÓN A LAS BASES DE DATOS NO RELACIONES Y LA FORMA DE HACER CONSULTAS A ESTAS A TRAVES DE PIPELINES CÓMO PODEMOS INTEGRARLO HACIENDO USO DE PYMONGO UN EJEMPLO DE FUEGO

Entorno de trabajo

NUESTRO OBJETIVO ES TENER UNA APLICACIÓN QUE HAGA USO DE DOS SISTEMAS DE BASE DE DATOS, UNO RELACIONAL (COMO POSTGRE SQL) Y OTRO NO RELACIONAL COMO PUEDE SER MONGODB

Introducción a MongoDB

Es un sistema de base de datos NO relacional orientado a documentos ¿Que es mongoDB? Es un sistema de base de datos NO relacional orientado a documentos Esta basado en documentos SIMILARES A JSON, concretamente BSON Es de CODIGO ABIERTO NOSQL Un conjunto de documentos es llamado COLECCIÓN y pueden ser distintos en una misma colección

Aggregation Framework

Aggregation Pipelines Es una serie de transformaciones que se ejecutan sobre un documento. El procesamiento de los datos se hace en memoria Puede usar índices para mejorar el rendimiento Son ejecutadas en fases (Stages) Usan un colleccion como entrada Obtenemos un cursor o una colección Conceptually, MongoDB sends each document in a collection into the first operator on the pipeline, which may modify it and send it along to the next operation, similar to a UNIX pipeline. When you're using aggregate, one thing to keep in mind is that order matters. Because of this, you want to place the most selective parts of your pipeline first, in order to reduce the number of documents successive pipeline stages have to process.

Operadores Pipeline $project: Modifica la estructura del documento $match: filtros de búsqueda en el documento $unwind: re-construye un campo del tipo vector para obtener un documento nuevo para cada uno de ellos $group: permite agrupar documentos y realizar calculos con los mismos. $sort: permite ordenar documentos por una clave $limit / $skip: permite paginar y limitar una consulta etc ... PROJECT - SELECT MATCH - WHERE GROUP - GROUPBY SORT - ORDERBY …

Lookup ES UN LEFT-JOIN: añade un nuevo array a los documentos que hacen matching sobre los criterios establecidos

Aggregation Framework Queries ad-hoc Extender modelos con datos almacenados en MONGODB Averages Summations Grouping Reshaping NUESTRA APLICACIÓN VA A TENER LOS DATOS REPARTIDOS EN DOS SISTEMAS DE BASES DE DATOS DISTINTOS ** OBJETIVO ** PODER OPERAR CON ELLOS DE UNA FORMA RÁPIDA Y SENCILLA PERMITIENDO ENTRE OTRAS ACCIONES LAS SIGUIENTES QUERIES ADHOC -> NOS DEBE PERMITIR PODER HACER CONSULTAS SOBRE ESOS DATOS: EXTENDER Y OPERAR CON COLECCIONES DE OBJETOS Y REALIZAR SUMAS PARA CADA UNO DE LOS OBJETOS DE ESA COLECCIÓN POR EJEMPLO AVERAGES SUMMATION GROUPING RESHAPING ** RESUMEN ** NOS VA A PERMITIR HACER UN RESHAPE (REMODELACIÓN) DE LOS OBJETOS ORIGINALES PARA AGREGAR INFORMACIÓN UTIL

GO GO GO!!

Modelo Survey

Modelo Template

Modelo SurveyDetail

Documento mongoDB Survey

Conectando con pymongo

Usando project para obtener datos de un objeto

Trabajando con querysets

Parametrizando nuestro Pipeline

Thanks for watching!!