Created
December 4, 2012 16:16
-
-
Save ozgun/4205700 to your computer and use it in GitHub Desktop.
mongo query by id
This file contains hidden or 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
| // 1980-01-01 ile 2012-12-04 18:22:27 +0200 tarihleri arasındaki kayıtların listelenmesi. | |
| // İlk 5 kayıt atlanır | |
| // 10 kayıt listelenir | |
| // id'ye göre tersten sıralama yapılır | |
| // tablo(collection) adı: reports | |
| db.reports.find({"_id": { "$gte": ObjectId('12cea6000000000000000000'), "$lte": ObjectId('50be23430000000000000000') }}).sort({ "_id": -1 }).skip(5).limit(10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment