Skip to content

Instantly share code, notes, and snippets.

@enginkartal
Last active December 4, 2015 09:03
Show Gist options
  • Save enginkartal/fcf3c265ce9f411ca144 to your computer and use it in GitHub Desktop.
Save enginkartal/fcf3c265ce9f411ca144 to your computer and use it in GitHub Desktop.
Mongodb Find Method
//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