API

API Docs

Mongoose

Schema

Connection

Document

Model

Query

QueryCursor

Aggregate

AggregationCursor

Schematype

Virtualtype

Error

SchemaArray

DocumentArrayPath

SubdocumentPath


Mongoose

  • Mongoose()
  • Mongoose.prototype.Aggregate()
  • Mongoose.prototype.CastError()
  • Mongoose.prototype.Collection()
  • Mongoose.prototype.Connection()
  • Mongoose.prototype.Date
  • Mongoose.prototype.Decimal128
  • Mongoose.prototype.Document()
  • Mongoose.prototype.DocumentProvider()
  • Mongoose.prototype.Error()
  • Mongoose.prototype.Mixed
  • Mongoose.prototype.Model()
  • Mongoose.prototype.Mongoose()
  • Mongoose.prototype.Number
  • Mongoose.prototype.ObjectId
  • Mongoose.prototype.Promise
  • Mongoose.prototype.PromiseProvider()
  • Mongoose.prototype.Query()
  • Mongoose.prototype.STATES
  • Mongoose.prototype.Schema()
  • Mongoose.prototype.SchemaType()
  • Mongoose.prototype.SchemaTypeOptions()
  • Mongoose.prototype.SchemaTypes
  • Mongoose.prototype.Types
  • Mongoose.prototype.VirtualType()
  • Mongoose.prototype.connect()
  • Mongoose.prototype.connection
  • Mongoose.prototype.connections
  • Mongoose.prototype.createConnection()
  • Mongoose.prototype.deleteModel()
  • Mongoose.prototype.disconnect()
  • Mongoose.prototype.driver
  • Mongoose.prototype.get()
  • Mongoose.prototype.isValidObjectId()
  • Mongoose.prototype.model()
  • Mongoose.prototype.modelNames()
  • Mongoose.prototype.mongo
  • Mongoose.prototype.mquery
  • Mongoose.prototype.now()
  • Mongoose.prototype.plugin()
  • Mongoose.prototype.pluralize()
  • Mongoose.prototype.sanitizeFilter()
  • Mongoose.prototype.set()
  • Mongoose.prototype.startSession()
  • Mongoose.prototype.trusted()
  • Mongoose.prototype.version

Mongoose()

Parameters

Mongoose constructor.

The exports object of the mongoose module is an instance of this class. Most apps will only use this one instance.

Example:

const mongoose = require('mongoose');
mongoose instanceof mongoose.Mongoose; // true

// Create a new Mongoose instance with its own `connect()`, `set()`, `model()`, etc.
const m = new mongoose.Mongoose();

Mongoose.prototype.Aggregate()

The Mongoose Aggregate constructor


Mongoose.prototype.CastError()

Parameters
  • type «String» The name of the type

  • value «Any» The value that failed to cast

  • path «String» The path a.b.c in the doc where this cast error occurred

  • [reason] «Error» The original error that was thrown

The Mongoose CastError constructor


Mongoose.prototype.Collection()

The Mongoose Collection constructor


Mongoose.prototype.Connection()

The Mongoose Connection constructor


Mongoose.prototype.Date

Type:
  • «property»

The Mongoose Date SchemaType.

Example:

const schema = new Schema({ test: Date });
schema.path('test') instanceof mongoose.Date; // true

Mongoose.prototype.Decimal128

Type:
  • «property»

The Mongoose Decimal128 SchemaType. Used for declaring paths in your schema that should be 128-bit decimal floating points. Do not use this to create a new Decimal128 instance, use mongoose.Types.Decimal128 instead.

Example:

const vehicleSchema = new Schema({ fuelLevel: mongoose.Decimal128 });

Mongoose.prototype.Document()

The Mongoose Document constructor.


Mongoose.prototype.DocumentProvider()

The Mongoose DocumentProvider constructor. Mongoose users should not have to use this directly


Mongoose.prototype.Error()

The MongooseError constructor.


Mongoose.prototype.Mixed

Type:
  • «property»

The Mongoose Mixed SchemaType. Used for declaring paths in your schema that Mongoose‘s change tracking, casting, and validation should ignore.

Example:

const schema = new Schema({ arbitrary: mongoose.Mixed });

Mongoose.prototype.Model()

The Mongoose Model constructor.


Mongoose.prototype.Mongoose()

The Mongoose constructor

The exports of the mongoose module is an instance of this class.

Example:

const mongoose = require('mongoose');
const mongoose2 = new mongoose.Mongoose();

Mongoo

(本文超出站点单文档体积上限,已截断)