diff --git a/docs/advanced_schemas.html b/docs/advanced_schemas.html index 39d7d940a89..c7f8567e9da 100644 --- a/docs/advanced_schemas.html +++ b/docs/advanced_schemas.html @@ -1,5 +1,4 @@ -Mongoose v5.4.7-pre: Advanced Schemas

Creating from ES6 Classes Using loadClass()

-

Mongoose allows creating schemas from ES6 classes. +Mongoose v5.4.9-pre: Advanced Schemas

Creating from ES6 Classes Using loadClass()

Mongoose allows creating schemas from ES6 classes. The loadClass() function lets you pull in methods, statics, and virtuals from an ES6 class. A class method maps to a schema method, a static method maps to a schema static, and getters/setters map diff --git a/docs/api.html b/docs/api.html index 14cea2fee8e..04c967feead 100644 --- a/docs/api.html +++ b/docs/api.html @@ -1,4 +1,4 @@ -Mongoose v5.4.7-pre: API docs

API Docs

+Mongoose v5.4.9-pre: API docs

API Docs


Index


Mongoose()

Type:
  • «function»

Mongoose constructor.

diff --git a/docs/browser.html b/docs/browser.html index b8c9b42ec5e..8fbdf0b4f87 100644 --- a/docs/browser.html +++ b/docs/browser.html @@ -1,4 +1,4 @@ -Mongoose v5.4.7-pre: Browser Library

Mongoose in the Browser

+Mongoose v5.4.9-pre: Browser Library

Mongoose in the Browser

Mongoose supports creating schemas and validating documents in the browser. Mongoose's browser library does not support saving documents, queries, @@ -12,6 +12,12 @@ // Using ES6 imports import mongoose from 'mongoose/browser'; +

+ +

Using the Browser Library

Mongoose's browser library is very limited. The only use case it supports diff --git a/docs/compatibility.html b/docs/compatibility.html index 0fdfb97c479..2ed8788bddb 100644 --- a/docs/compatibility.html +++ b/docs/compatibility.html @@ -1,4 +1,4 @@ -Mongoose v5.4.7-pre: MongoDB Version Compatibility

MongoDB Server Version Compatibility

+Mongoose v5.4.9-pre: MongoDB Version Compatibility

MongoDB Server Version Compatibility

Connections

+Mongoose v5.4.9-pre: Connecting to MongoDB

Connections

Contributing

+Mongoose v5.4.9-pre: Contributing

Contributing

Please read all about contributing here.

Creating a Basic Custom Schema Type

-

New in Mongoose 4.4.0: Mongoose supports custom types. Before you +Mongoose v5.4.9-pre: Custom Schema Types

Creating a Basic Custom Schema Type

New in Mongoose 4.4.0: Mongoose supports custom types. Before you reach for a custom type, however, know that a custom type is overkill for most use cases. You can do most basic tasks with custom getters/setters, diff --git a/docs/defaults.html b/docs/defaults.html index d20e1585063..ea57a21aa58 100644 --- a/docs/defaults.html +++ b/docs/defaults.html @@ -1,5 +1,4 @@ -Mongoose v5.4.7-pre: Defaults

Declaring defaults in your schema

-

Your schemas can define default values for certain paths. If you create +Mongoose v5.4.9-pre: Defaults

Declaring defaults in your schema

Your schemas can define default values for certain paths. If you create a new document without that path set, the default will kick in.

Note: Mongoose only applies a default if the value of the path is strictly undefined.

@@ -33,8 +32,7 @@ }); }); -

Default functions

-

You can also set the default schema option to a function. Mongoose will +

Default functions

You can also set the default schema option to a function. Mongoose will execute that function and use the return value as the default.

var schema = new Schema({
@@ -54,8 +52,7 @@ 

Default functions

assert.ok(post.date.getTime() >= Date.now() - 1000); assert.ok(post.date.getTime() <= Date.now());

-

The setDefaultsOnInsert option

-

By default, mongoose only applies defaults when you create a new document. +

The setDefaultsOnInsert option

By default, mongoose only applies defaults when you create a new document. It will not set defaults if you use update() and findOneAndUpdate(). However, mongoose 4.x lets you opt-in to this behavior using the setDefaultsOnInsert option.

@@ -90,8 +87,7 @@

Important

assert.equal(doc.genre, 'Action'); }); -

Default functions and this

-

Unless it is running on a query with setDefaultsOnInsert, a default +

Default functions and this

Unless it is running on a query with setDefaultsOnInsert, a default function's this refers to the document.

const schema = new Schema({
diff --git a/docs/deprecations.html b/docs/deprecations.html
index c22785e4057..cae5a98e890 100644
--- a/docs/deprecations.html
+++ b/docs/deprecations.html
@@ -1,4 +1,4 @@
-Mongoose v5.4.7-pre: Deprecation Warnings

Deprecation Warnings

+Mongoose v5.4.9-pre: Deprecation Warnings

Deprecation Warnings

-

Discriminators save to the Event model's collection

-

Suppose you created another discriminator to track events where +

Discriminators save to the Event model's collection

Suppose you created another discriminator to track events where a new user registered. These SignedUpEvent instances will be stored in the same collection as generic events and ClickedLinkEvent instances.

@@ -52,8 +50,7 @@

Discriminator keys

-

The way mongoose tells the difference between the different +

Discriminator keys

The way mongoose tells the difference between the different discriminator models is by the 'discriminator key', which is __t by default. Mongoose adds a String path called __t to your schemas that it uses to track which discriminator @@ -67,8 +64,7 @@

Discriminator keys< assert.equal(event2.__t, 'ClickedLink'); assert.equal(event3.__t, 'SignedUp'); -

Discriminators add the discriminator key to queries

-

Discriminator models are special; they attach the discriminator key +

Discriminators add the discriminator key to queries

Discriminator models are special; they attach the discriminator key to queries. In other words, find(), count(), aggregate(), etc. are smart enough to account for discriminators.

@@ -91,8 +87,7 @@

Discriminators copy pre and post hooks

-

Discriminators also take their base schema's pre and post middleware. +

Discriminators copy pre and post hooks

Discriminators also take their base schema's pre and post middleware. However, you can also attach middleware to the discriminator schema without affecting the base schema.

@@ -127,8 +122,7 @@

Handling custom _id fields

-

A discriminator's fields are the union of the base schema's fields and +

Handling custom _id fields

A discriminator's fields are the union of the base schema's fields and the discriminator schema's fields, and the discriminator schema's fields take precedence. There is one exception: the default _id field.

You can work around this by setting the _id option to false in the @@ -158,8 +152,7 @@

Han assert.ok(typeof event1._id === 'string'); assert.ok(typeof event1.time === 'string'); -

Using discriminators with Model.create()

-

When you use Model.create(), mongoose will pull the correct type from +

Using discriminators with Model.create()

When you use Model.create(), mongoose will pull the correct type from the discriminator key for you.

var Schema = mongoose.Schema;
@@ -188,8 +181,7 @@ 

2].side, 10); });

-

Embedded discriminators in arrays

-

You can also define discriminators on embedded document arrays. +

Embedded discriminators in arrays

You can also define discriminators on embedded document arrays. Embedded discriminators are different because the different discriminator types are stored in the same document array (within a document) rather than the same collection. In other words, embedded discriminators let @@ -261,8 +253,7 @@

catch(done); -

Recursive embedded discriminators in arrays

-

You can also define embedded discriminators on embedded discriminators. +

Recursive embedded discriminators in arrays

You can also define embedded discriminators on embedded discriminators. In the below example, sub_events is an embedded discriminator, and for sub_event keys with value 'SubEvent', sub_events.events is an embedded discriminator.

diff --git a/docs/documents.html b/docs/documents.html index 52c18d0fe24..9d1aa4821ed 100644 --- a/docs/documents.html +++ b/docs/documents.html @@ -1,4 +1,4 @@ -Mongoose v5.4.7-pre: Documents

Documents

+Mongoose v5.4.9-pre: Documents

Documents

FAQ

+

FAQ

Further Reading

+

Further Reading

Using GeoJSON

+Mongoose v5.4.9-pre: Using GeoJSON

Using GeoJSON

GeoJSON is a format for storing geographic points and polygons. MongoDB has excellent support for geospatial queries on GeoJSON objects. Let's take a look at how you can use Mongoose to store diff --git a/docs/guide.html b/docs/guide.html index f040182f51c..4b76c3daf71 100644 --- a/docs/guide.html +++ b/docs/guide.html @@ -1,4 +1,4 @@ -Mongoose v5.4.7-pre: Schemas

Schemas

+Mongoose v5.4.9-pre: Schemas

Schemas

Guides

+Mongoose v5.4.9-pre: Schemas

Guides

Mongoose guides provide detailed tutorials on Mongoose's core concepts and integrating Mongoose with external tools and frameworks.

Mongoose Core Concepts

diff --git a/docs/index.html b/docs/index.html index 41dc899b6fb..dfc8fdb7d6a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,4 @@ -Mongoose v5.4.7-pre: Getting Started

Getting Started

+

Getting Started

First be sure you have MongoDB and Node.js installed.

Next install Mongoose from the command line using npm:

$ npm install mongoose
diff --git a/docs/jest.html b/docs/jest.html
index 7aee213ec2a..2b5b0bb361e 100644
--- a/docs/jest.html
+++ b/docs/jest.html
@@ -1,4 +1,4 @@
-Mongoose v5.4.7-pre: Testing Mongoose with Jest

Testing Mongoose with Jest

+Mongoose v5.4.9-pre: Testing Mongoose with Jest

Testing Mongoose with Jest

Jest is a client-side JavaScript testing library developed by Facebook. It was one of the libraries affected by Facebook's licensing scandal in 2017. Because Jest is designed primarily for testing React applications, using diff --git a/docs/lambda.html b/docs/lambda.html index 05ac644e5c0..b823717ce56 100644 --- a/docs/lambda.html +++ b/docs/lambda.html @@ -1,4 +1,4 @@ -Mongoose v5.4.7-pre: Using Mongoose With AWS Lambda

Using Mongoose With AWS Lambda

AWS Lambda is a popular service for running +Mongoose v5.4.9-pre: Using Mongoose With AWS Lambda

Using Mongoose With AWS Lambda

AWS Lambda is a popular service for running arbitrary functions without managing individual servers. Using Mongoose in your AWS Lambda functions is easy. Here's a sample function that connects to a MongoDB instance and finds a single document:

diff --git a/docs/middleware.html b/docs/middleware.html index 0de44799e99..c3358caaaa6 100644 --- a/docs/middleware.html +++ b/docs/middleware.html @@ -1,4 +1,4 @@ -Mongoose v5.4.7-pre: Middleware

Middleware

+Mongoose v5.4.9-pre: Middleware

Middleware

Migrating from 4.x to 5.x

+

Migrating from 4.x to 5.x

Migrating from 3.x to 4.x

There are several backwards-breaking changes to be aware of when migrating from Mongoose 3 to Mongoose 4.

+

Migrating from 3.x to 4.x

There are several backwards-breaking changes to be aware of when migrating from Mongoose 3 to Mongoose 4.

findOneAndUpdate() new field is now false by default

Mongoose's findOneAndUpdate(), findOneAndRemove(), diff --git a/docs/models.html b/docs/models.html index 669e18be542..fa23ef7f8c4 100644 --- a/docs/models.html +++ b/docs/models.html @@ -1,4 +1,4 @@ -Mongoose v5.4.7-pre: Models

Models

+Mongoose v5.4.9-pre: Models

Models

Plugins

+Mongoose v5.4.9-pre: Plugins

Plugins

Populate

+Mongoose v5.4.9-pre: Query Population

Populate

Built-in Promises

-

Mongoose async operations, like .save() and queries, return thenables. +Mongoose v5.4.9-pre: Promises

-

Queries are not promises

-

Mongoose queries are not promises. They have a .then() +

Queries are not promises

Mongoose queries are not promises. They have a .then() function for co and async/await as a convenience. If you need a fully-fledged promise, use the .exec() function.

@@ -39,8 +37,7 @@

Queries // use doc }); -

Plugging in your own Promises Library

-

If you're an advanced user, you may want to plug in your own promise +

Plugging in your own Promises Library

If you're an advanced user, you may want to plug in your own promise library like bluebird. Just set mongoose.Promise to your favorite ES6-style promise constructor and mongoose will use it.

diff --git a/docs/queries.html b/docs/queries.html index c293b9dd8b2..b03e19470b5 100644 --- a/docs/queries.html +++ b/docs/queries.html @@ -1,4 +1,4 @@ -Mongoose v5.4.7-pre: Queries

Queries

+Mongoose v5.4.9-pre: Queries

Queries

SchemaTypes

+Mongoose v5.4.9-pre: SchemaTypes

SchemaTypes

Subdocuments

+Mongoose v5.4.9-pre: SubDocuments

Subdocuments

Transactions in Mongoose

+Mongoose v5.4.9-pre: Transactions

Transactions in Mongoose

Transactions are new in MongoDB 4.0 and Mongoose 5.2.0. Transactions let you execute multiple operations in isolation and potentially undo all the operations if one of them fails. diff --git a/docs/validation.html b/docs/validation.html index 3473f0b2377..56af44785a7 100644 --- a/docs/validation.html +++ b/docs/validation.html @@ -1,5 +1,4 @@ -Mongoose v5.4.7-pre: Validation

Validation

-

Before we get into the specifics of validation syntax, please keep the following rules in mind:

+Mongoose v5.4.9-pre: Validation

Validation

Before we get into the specifics of validation syntax, please keep the following rules in mind: