Get Started Free

27. Page 6 without skip Solved

PerformanceExpertpaginationkeyset / seek methodtie-breakers

The admin list shows orders newest first, 10 per page, ordered by placedAt desc then _id desc. The last order on page 5 was { placedAt: ISODate("2026-08-27T22:38:00.000Z"), _id: ObjectId("0d3e000000000000000000b7") }. Return page 6 (number, placedAt) without skip, reading at most 11 index keys and exactly 10 documents.

Your answer returns 10 documents with the fields number, placedAt. Order matters.

The data

The shop database from the MongoDB playground, running in your browser. "Today" is 2026-11-18.

categories18 docs
_idObjectId
namestring
parentIdnull | ObjectId
pathstring
suppliers6 docs
_idObjectId
namestring
countrystring
ratingdouble
sincedate
products26 docs
_idObjectId
skustring
namestring
categoryIdObjectId
supplierIdObjectId
pricedecimal
tagsarray of string
stockarray of objects
warehouse qty
activeboolean
createdAtdate
customers30 docs
_idObjectId
namestring
emailstring
tierstring
addressesarray of objects
type street city country zip location
preferencesobject
newsletter currency
lifetimeValuedecimal
joinedAtdate
marketingOptInboolean
phonestring, 24 of 30
lastLogindate, 15 of 30
externalRefint | string, 10 of 30
loyaltyPointsint, 18 of 30
referredByObjectId, 17 of 30
orders220 docs
_idObjectId
numberstring
customerIdObjectId
placedAtdate
statusstring
statusHistoryarray of objects
status at
itemsarray of objects
productId sku name qty unitPrice
shippingobject
type street city country zip location method
totaldecimal
currencystring
supportAgentIdObjectId, 33 of 220
notestring, 33 of 220
reviews87 docs
_idObjectId
productIdObjectId
customerIdObjectId
orderIdObjectId
ratingint
commentstring
atdate
employees9 docs
_idObjectId
namestring
titlestring
reportsTonull | ObjectId

Hints

Common traps
  • .skip(50) still walks 60 index entries: page 600 walks 6,000.
  • Paging on placedAt alone skips or repeats orders that share a timestamp.

Solution

Run in the shell with Ctrl/⌘ + Enter. Check with Shift + Ctrl/⌘ + Enter.

"Check answer" runs your shell code on a fresh copy of the data, then on 2 hidden test datasets with more customers and orders, and compares each result with the expected one. The value of your last line is your answer.

Starting…