Skip to content

Commit

Permalink
Update 3.1-MongoDB.md
Browse files Browse the repository at this point in the history
erratas de transparencias
  • Loading branch information
edgartamu authored May 7, 2024
1 parent 8cf9cd9 commit 65f2cf5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Slides/3.1-MongoDB.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ h2{line-height: 0}
## Método db.collection.find() - Operador **$elemMatch**
### Sintaxis
``{ field : { $elemMatch: [ <value1> , <value2> ... ] } }``
#### Documentos donde ratings sea un array que contiene al menos un elemento que cumple ambas condiciones.
#### Documentos donde ratings sea un array que contiene al menos un elemento que cumple ambas.
``db.reviews.find({ ratings: { $elemMatch: { rating: { $gte: 4}, timestamp:{$gt:10} }}})``

## Método db.collection.find() - Operador **$slice**
Expand Down Expand Up @@ -571,10 +571,10 @@ db.movies.find({}).sort({year: -1})
]
}
```
- Para acceder utilizaremos el operador ".", en caso de que queramos indicar que queremos todos los campos usaremos "$"
- Para acceder utilizaremos el operador ".", en caso de que queramos indicar que queremos todos los campos usaremos el principal.
```python
db.movies.find({"ratings.rating":5}), {"ratings.rating":1}
db.movies.find({"ratings.rating":5}), {"ratings.$":1}
db.movies.find({"ratings.rating":5}), {"ratings":1}
```

---
Expand Down Expand Up @@ -990,4 +990,4 @@ Unir las colecciones movies y ratings por el campo **movieId**, y guarda los res
<center>

![w:450](images/t3.1/Mongojoke.jpg)
</center>
</center>

0 comments on commit 65f2cf5

Please sign in to comment.