100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Presentation

Consultas en MongoDB(NOSQL)

Rating
-
Sold
-
Pages
33
Uploaded on
01-04-2021
Written in
2020/2021

En el siguente documento veemos como relizar variedad de consultas en una base de datos, esto con el proposito de ver como trabaja una base de datos NOSQL, trabajaremos con MongoDB este documento cuenta con mas de 50 consultas

Institution
Course











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Course

Document information

Uploaded on
April 1, 2021
Number of pages
33
Written in
2020/2021
Type
Presentation
Person
Unknown

Subjects

Content preview

UNIVERSIDAD
TECNOLÓGICA
DE PUEBLA


TECNOLOGÍAS DE LA
INFORMACIÓN


BASE DE DATOS PARA
CÓMPUTO EN LA
NUBE


5° D


PROFESORA: MA. DEL
ROSARIO TITLA
FLORES


SUBPRODUCTO 8



Uriel Isaí Hernández
Hernández

, UNIVERSIDAD TECNOLÓGICA DE
PUEBLA


CONTENIDO

Insertar Inserta 15 documentos en la colección productos...............................................................3
Operadores de comparación..............................................................................................................3
Operador relacional. $ne (not equals). CREA UNA CONSULTA.....................................3
Función limit( ) CREA UNA CONSULTA..........................................................................4
Consulta de documentos, criterio de búsqueda con un campo. CREA UNA CONSULTA
......................................................................................................................................................... 5
Función count ( ). CREA UNA CONSULTA.....................................................................5
Consulta de documentos, criterio de búsqueda con más de un campo. CREA UNA
CONSULTA..................................................................................................................... 5
Operador de comparación EQUAL IGUAL QUE "$eq". CREA UNA CONSULTA.....6
Operador de comparación NO EQUAL NO IGUAL "$ne". CREA UNA
CONSULTA..................................................................................................................... 7
Operador de comparación MAYOR QUE Great than "$gt". CREA UNA CONSULTA...7
Operador de comparación MAYOR QUE O IGUAL Great than or equal to "$gte".
CREA UNA CONSULTA..................................................................................................9
Operador de comparación MENOR QUE Less than "$lt". CREA UNA CONSULTA. . .9
Operador de comparación MENOR QUE O IGUAL Less than or equal to "$lte". CREA
UNA CONSULTA........................................................................................................... 10
Utilizar más de un operador. CREA UNA CONSULTA.................................................11
Operador de comparación IGUAL "$eq" EN UN OBJETO. CREA UNA CONSULTA 11
Operador $in CREA UNA CONSULTA........................................................................12
Operador $nin (not in). CREA UNA CONSULTA...........................................................12
Operador $and. CREA UNA CONSULTA....................................................................13
Operador $and (campos diferentes). CREA UNA CONSULTA.....................................13
Operador $or. CREA UNA CONSULTA......................................................................16
Queries en arrays. CREA UNA CONSULTA...............................................................17
Operador $all en los campos de tipo array. CREA UNA CONSULTA...........................18
CRUD Update...................................................................................................................................19
Actualizar campos de un objeto embebido. CREA UNA CONSULTA...........................19
Agregar un campo a un objeto embebido. CREA UNA CONSULTA............................20
Agregar un campo a un documento. CREA UNA CONSULTA.....................................21
Eliminar un campo de un documento. CREA UNA CONSULTA...............................22



MODULO: BASE DE DATOS PARA CÓMPUTO EN LA NUBE

, UNIVERSIDAD TECNOLÓGICA DE
PUEBLA
Función updateMany. CREA UNA CONSULTA.......................................................22
Función updateOne. CREA UNA CONSULTA...........................................................24
Dos operaciones al mismo tiempo:actualizar un campo y borrar otro campo. CREA
UNA CONSULTA........................................................................................................... 25
Operador rename. CREA UNA CONSULTA...............................................................26
Agregar un campo con tipo de dato Date, la fecha la obtine del sistema. CREA UNA
CONSULTA................................................................................................................... 26
Campos tipo de dato Date, la fecha la obtiene del parámetro dado por el usuario.
CREA UNA CONSULTA................................................................................................26
Operador $currentDate. CREA UNA CONSULTA.........................................................27
operador push para agregar un elemento al array CREA UNA CONSULTA............27
Operador push para agregar un campo de tipo array. CREA UNA CONSULTA.........27
Operador each (cada). CREA UNA CONSULTA....................................................28
operador addToSet CREA UNA CONSULTA.........................................................28
El operador addToSet - each CREA UNA CONSULTA........................................29
Operador pop. CREA UNA CONSULTA..................................................................29
Eliminar el primer elemento del array operardor pop. CREA UNA CONSULTA.......30
Operador pull elimina un elemento específico del array. CREA UNA CONSUL.........30
Operador pullAll. CREA UNA CONSULTA.................................................................30
Modificar un elemento del array por su posicion. CREA UNA CONSULTA..............31
CRUD Delete.....................................................................................................................................31
Group By y Funciones de Agregado. CREA UNA CONSULTA...................................31
Función de agregado $sum. CREA UNA CONSULTA................................................31
Función de agregado $max. CREA UNA CONSULTA.................................................31
Función de agregado $min. CREA UNA CONSULTA..................................................32
Función de agregado $avg – promedio. CREA UNA CONSULTA...........................32
$group y $sum. CREA UNA CONSULTA.................................................................32




MODULO: BASE DE DATOS PARA CÓMPUTO EN LA NUBE

, UNIVERSIDAD TECNOLÓGICA DE
PUEBLA

Insertar Inserta 15 documentos en la colección Peliculas.




Operadores de comparación.
Operador relacional. $ne (not equals). CREA UNA CONSULTA

Sentencia:
db.Peliculas.find({idioma:{$ne: "Frances"}}, {_id:0,titulo:1,Fecha_lanzamiento:1,idioma:1,Sinopsis:1}).pretty( )

Ejecución y resultados:




MODULO: BASE DE DATOS PARA CÓMPUTO EN LA NUBE
CA$28.08
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
sicksoldier

Get to know the seller

Seller avatar
sicksoldier Centro Universitario Villanueva
Follow You need to be logged in order to follow users or courses
Sold
1
Member since
4 year
Number of followers
1
Documents
2
Last sold
4 year ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions