Skip to content

$skip

Skips over a specified number of documents.


Syntax

{ "$skip": <nonNegativeInteger> }

The integer specifies how many leading documents to drop before emitting results.


✅ Basic Example

📌 Stage

{
  "$skip": 1
}

📥 Input

[
  {
    "a": 1
  },
  {
    "a": 2
  },
  {
    "a": 3
  }
]

📤 Output

[
  {
    "a": 2
  },
  {
    "a": 3
  }
]

🧱 Deep Nested Pipeline Usage (Ecommerce)

[
  {
    "$sort": {
      "price": 1
    }
  },
  {
    "$skip": 2
  }
]

📥 Input Document

[
  {
    "price": 10
  },
  {
    "price": 30
  },
  {
    "price": 20
  }
]

📤 Output Documents

[
  {
    "price": 30
  }
]

➕ Supported Accumulators

None for this stage


🔧 Common Operators

None