db.getCollection('spring').find({"name": "shimul"}) db.getCollection('spring').find({}, {_id: 1, name:1}).pretty();
db.getCollection('spring').find({$and: [{"name": "shimul"}, {"email": "shimul@gmail.com"} ]})
db.getCollection('spring').find({$or: [{"name": "hasan"}, {"email": "shimul@gmail.com"} ]})
db.getCollection('spring').find({"name": { $in: ["mahadi","hasan","shimul"] }})
db.getCollection('student').update(
// query
{
"name" : "mahadi"
},
// update
{
$set: {
"phone": "01830889631"
}
},
// options
{
"multi" : false, // update only one document
"upsert" : false // insert a new document, if no existing document match the query
}
);
db.getCollection('student').remove({ });
db.getCollection('student').remove({ 'name' : 'shimul' });
db.getCollection('student').find({"email": /gmail/});
db.getCollection('student').find({"name": /^Mahadi/})
sudo docker run --name docker-mongo -v /home/software/fileuploads/mongodata:/data/db -d -p 27017:27017 mongo
https://docs.mongodb.com/compass/current/install/
sudo apt-get autoremove --purge mongodb
sudo dpkg --remove mongodb-compass
sudo apt --fix-broken install
sudo docker run --name docker-mongo -e MONGO_INITDB_ROOT_USERNAME=mongoadmin -e MONGO_INITDB_ROOT_PASSWORD=mongo092624 -v /opt/fileuploads/mongodata:/data/db -d -p 27017:27017 mongo