Buscar los que tengan un ‘rating’ mayor de 10
Buscar los que tengan la propiedad color
Buscar los que sean para (‘for’) ‘ac3’
Buscar los que en la propiedad ‘n’ de ‘data’ de ‘limits’ sea ‘unlimited’
—
Modificar el teléfono «»AC3 Case Black» y ponerle un ‘price’ de 15
Modificar los teléfonos que tengan ‘term_year’ a 1 y ponerle un monthly_price de 80
Eliminar los teléfonos que tengan un rating menor de dos
db.telefonos.find( { rating: {$gt: 10} } )
db.telefonos.find( { color: {$exists: true} } )
db.telefonos.find( { for: {$all: [‘ac3’ ] } } )
db.telefonos.find( { «limits.data.n»: ‘unlimited’ })
— Buscar los que tengan un ‘rating’ mayor de 10
db.productos.find( { rating: {$gt:10} } )
— Buscar los que tengan la propiedad color
db.productos.find( { color : { $exists: true } } )
— Buscar los que sean para (‘for’) ‘ac3’
db.productos.find( { «for»: «ac3» } )
— Buscar los que en la propiedad ‘n’ de ‘data’ de ‘limits’ sea ‘unlimited’
db.productos.find( { «limits.data.n»: «unlimited» } )
1.- db.telefono.find({rating:{ $gt: 10 }})
2.- db.telefono.find( { color : { $exists: false } } )
3.- db.telefono.find( { for:»ac3″} )
4.- db.telefono.find( { «limits.data.n»:»unlimited»} )
db.productos.find( { rating: { $gt: 10 } } )
db.productos.find({color: {$exists:true}})
db.productos.find({ for: { $regex: /ac3/, $options: » } })
db.productos.find( { «limits.data.n»: «unlimited» })
db.productos.updateOne(
{ name: «AC3 Case Black» },
{
$set: {
price: 15
}
}
)
db.productos.updateMany(
{ term_years: 1 },
{
$set: {
monthly_price: 80
}
}
)
db.productos.deleteMany(
{ rating: {$lt:2} }
)
db.telefonos.find({rating:{$gt:10}})
db.telefonos.find( {color : {$exists: true }})
db.telefonos.find({for:»ac3″})
db.telefonos.find({«limits.data.n»:»unlimited»})
db.telefonos.find( { rating: {$gt:3} } )
db.telefonos.find( { color: {$exists: true} } )
db.telefonos.find( { for: {$all: [‘ac3’ ] } } )
db.telefonos.find( { ‘limits.data.n’: ‘unlimited’ })
db.telefonos.updateOne( {name: «AC3 Case Black»}, { $set: {price: 15}} )
db.telefonos.updateOne( {term_years: 1}, { $set: {monthly_price: 80}} )
db.telefonos.deleteMany( { rating: {$lt: 2 } } )
— Modificar el teléfono «»AC3 Case Black» y ponerle un ‘price’ de 15 —
db.productos.updateOne({name: «AC3 Case Black»}, {$set: {price: 15}})
— Modificar los teléfonos que tengan ‘term_year’ a 1 y ponerle un monthly_price de 80 —
db.productos.updateMany({term_years: 1}, {$set: {monthly_price: 80}})
— Eliminar los teléfonos que tengan un rating menor de dos —
db.productos.deleteMany({ rating: { $lt: 2 }})
db.telefonos.updateOne( {name: ‘AC3 Case Black’}, { $set: {price: 15}} )
{ acknowledged: true,
insertedId: null,
matchedCount: 1,
modifiedCount: 1,
upsertedCount: 0 }
db.telefonos.updateOne( {term_year: 1}, { $set: {monthly_price: 80}} )
{ acknowledged: true,
insertedId: null,
matchedCount: 0,
modifiedCount: 0,
upsertedCount: 0 }
db.telefonos.deleteMany({rating:{$lt:2}})
{ acknowledged: true, deletedCount: 1 }
db.telefonos.updateOne( { name: «AC3 Case Black» }, { $set: { «price»: 15 }})
db.telefonos.updateOne( { term_years: 1 }, { $set: { «monthly_price»: 80 }})
db.telefonos.deleteMany({rating:{$lt: 2 }})