Type alias CollectionFindAndRerankOptions

CollectionFindAndRerankOptions: GenericFindAndRerankOptions
Overview

The options for a findAndRerank command on a Collection.

Example

const results = await collection.findAndRerank({
category: 'books',
}, {
sort: { $hybrid: { $vectorize: 'fantasy novels', $lexical: 'dragons' } },
limit: 5,
timeout: 10000,
});

Builder Methods

You can also use fluent builder methods on the cursor:

Example

const cursor = collection.findAndRerank({ category: 'books' })
.sort({ $hybrid: { $vectorize: 'fantasy novels', $lexical: 'dragons' } })
.limit(5)
.includeScores(true);

const results = await cursor.toArray();

See

  • Collection.findAndRerank
  • CollectionFindAndRerankCursor