Options
All
  • Public
  • Public/Protected
  • All
Menu

RemoteMongoDatabase

RemoteMongoDatabase provides access to a MongoDB database.

It is instantiated by RemoteMongoClient.

Once instantiated, it can be used to access a RemoteMongoCollection for reading and writing data.

Example

// Get the logged-in Stitch client
const stitchClient = Stitch.defaultAppClient

// Get a client of the Remote Mongo Service for database access
const mongoClient = stitchClient.getServiceClient(RemoteMongoClient.factory, 'mongodb-atlas')

// Retrieve a database object
const db = mongoClient.db('video')

// Retrieve the collection in the database
const movieDetails = db.collection('movieDetails')

// Find 10 documents and log them to console.
movieDetails.find({}, {limit: 10})
  .toArray()
  .then(results => console.log('Results:', results))

See Also

Hierarchy

  • RemoteMongoDatabase

Index

Properties

Methods

Properties

name

name: string

Gets the name of the database.

Methods

collection

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