Options
All
  • Public
  • Public/Protected
  • All
Menu

RemoteFindOptions

Options to use when executing a find command on a RemoteMongoCollection.

Example

// Assumption: Stitch is already logged in

// Work with the movies collection
const moviesCollection = db.collection('movieDetails')

const options = { // Match the shape of RemoteFindOptions.
  limit: 10,      // Return only first ten results.
  projection: {   // Return only the `title`, `releaseDate`, and
    title: 1,     //   (implicitly) the `_id` fields.
    releaseDate: 1,
  },
  sort: { // Sort by releaseDate descending (latest first).
    releaseDate: -1,
  },
}

moviesCollection
  .find({}, options) // Match any document with {} query. Pass the options as the second argument.
  .toArray()
  .then(movies => console.log('Ten latest movies:', movies))
  .catch(console.error)

See Also

Hierarchy

  • RemoteFindOptions

Index

Properties

Properties

Optional limit

limit: undefined | number

The maximum number of documents to return.

Optional projection

projection: undefined | object

Limits the fields to return for all matching documents. See Tutorial: Project Fields to Return from Query.

Optional sort

sort: undefined | object

The order in which to return matching documents.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc