Mongo Shell - Find
JSON | BSON |
---|---|
mongoimport | mongorestore |
mongoexport | mongodump |
Sample Data Restore
Aşağıdaki link üzerinden eğitim için kullanacağımız örnek datalara ulaşabilirsiniz.
show dbs;
use sample_airbnb
show collections;
Find & FindOne
use sample_mflix
show collections
db.movies.findOne()
db.movies.find()
Type "it" for more
it
Pretty()
db.movies.find().pretty()
Count()
db.movies.find().count()
Find({'filed':'value'})
db.movies.find({'year':1983})
Subdocument Find
db.movies.find({'year':1983, 'imdb.rating':6.2})
db.movies.find({'year':1983, 'imdb.rating':6.2,'countries':['Italy']}).pretty()
Find Filter Filed (3F) ( Böyle bir Tabir Yok :))
db.movies.find({'year':1983, 'imdb.rating':6.2},{'cast':1}).pretty()