Last active
December 4, 2015 09:03
-
-
Save enginkartal/fcf3c265ce9f411ca144 to your computer and use it in GitHub Desktop.
Mongodb Find Method
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. | |
db.collection.findOne({}) | |
//aşağıdaki kullanımda geriye tek doküman döndürür. | |
db.collection.find({}).limit(1) | |
//SQL | |
select top 1 * from table |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment