Skip to content

Instantly share code, notes, and snippets.

@ozgun
Created December 4, 2012 16:16
Show Gist options
  • Select an option

  • Save ozgun/4205700 to your computer and use it in GitHub Desktop.

Select an option

Save ozgun/4205700 to your computer and use it in GitHub Desktop.
mongo query by id
// 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