Browse/MongoDB/Query Documents
Query Documents
MongoDB
$19 · Pro
Query documents from a MongoDB collection with a filter using the official driver.
queryDocuments.ts
const cursor = orders.find(filter).sort({ createdAt: -1 }).limit(20);
Unlock the full snippet
This is a Pro snippet — get all-access for $19, or unlock just this one snippet for $1.
Query Documents — MongoDB Example (TypeScript, Node, Python, Go, PHP, Ruby) | apiexamples