Type alias CollectionFindOptions

CollectionFindOptions: GenericFindOptions
Overview

The options for a find command on a Collection.

Example

const results = await collection.find({
category: 'electronics',
}, {
sort: { price: 1 },
limit: 10,
timeout: 10000,
});

Builder Methods

You can also use fluent builder methods on the cursor:

Example

const cursor = collection.find({ category: 'electronics' })
.sort({ price: 1 })
.limit(10)
.skip(5);

const results = await cursor.toArray();

See

  • Collection.find
  • CollectionFindCursor