This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Bu şekilde kullanıldığında sonuç görüntüsü kolay okunabilir bir format halini geliyor. | |
db.collection.find(<koşul>).pretty() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//bu query likes sayısı 5 eşit olan dökümanları getirir. | |
db.collection.find({likes:5}) | |
//Sonuç | |
{ | |
_id:ObjectId("507f191e810c19729de860ea"), | |
title: 'MongoDB Insert', | |
description: 'MongoDB Kayıt ekleme', | |
author: 'Engin Kartal', | |
url: 'http://www.enginkartal.com.tr', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//content.json | |
{ | |
_id:ObjectId("507f191e810c19729de860ea"), | |
title: 'MongoDB Insert', | |
description: 'MongoDB Kayıt ekleme', | |
author: 'Engin Kartal', | |
url: 'http://www.enginkartal.com.tr', | |
keywors: ['mongodb', 'database', 'insert'], | |
likes: 5, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Author: Engin Kartal | |
//Blog Post: http://enginkartal.com.tr/mongodb-find/ | |
//bu metod tüm dokümanları getirir. | |
db.collection.find({}) | |
//SQL | |
select * from table | |
//bu metod geriye tek doküman döndürür. |
NewerOlder