MongoDB
Databaza = Databaza
Tabulka = Kolekcia
Zaznam = Dokument
Stlpec = Pole
Zobrazit
show dbs;
show databases;
use products
db.products.find().pretty()
db.products.find({ cena: 20})
db.products.find({ cena: { $gt: 20 }})
db.products.find({}, {pole:1})
db.products.insertOne( { name: "tricko", price: 110, details: { memory: 10, cpu: 2} })
insertMany - vlozi sa po jednom, ak jeden failne, naledovne uz sa nevlozia
{ordered: false} - pokracuje aj po faile
db.products.deleteMany({})
db.products.deleteOne({ price: 110 })
db.products.updateOne({ price: 100 }, {$set: { price: "99 "}})
db.products.updateOne({ }, {$set: { price: "99 "}})
Príspevok pridaný dňa: 20.08.2023 od užívatela: Dodoslav.