Diferencia entre revisiones de «Mongo DB»
De enunpimpam
Línea 2: | Línea 2: | ||
https://docs.mongodb.com/manual/crud/ | https://docs.mongodb.com/manual/crud/ | ||
show collections | show collections | ||
+ | |||
+ | db.products.find() | ||
db.inventory.insertOne( | db.inventory.insertOne( |
Revisión del 10:38 5 sep 2020
https://docs.mongodb.com/manual/crud/
show collections
db.products.find()
db.inventory.insertOne(
{ "item" : "canvas", "qty" : 100, "tags" : ["cotton"], "size" : { "h" : 28, "w" : 35.5, "uom" : "cm" } }
)
db.collection.find() https://docs.mongodb.com/manual/reference/method/db.collection.find/#db.collection.find
https://docs.mongodb.com/manual/reference/operator/query/
busca los que tienen mas de 5 en stock
db.products.find({stock: {$gt: 5}})