Skip to content

Commit

Permalink
Merge branch 'master' into 5.10
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jun 5, 2020
2 parents eab6cc0 + 2d2e0a8 commit 0e0b8fa
Show file tree
Hide file tree
Showing 77 changed files with 1,194 additions and 630 deletions.
49 changes: 49 additions & 0 deletions History.md
@@ -1,3 +1,52 @@
5.9.18 / 2020-06-05
===================
* fix: improve atlas error in the event of incorrect password #9095
* docs: add edit link for all docs pages #9058
* fix(document): allow accessing `$locals` when initializing document #9099 #9098 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
* fix(query): make `setDefaultsOnInsert` a mongoose option so it doesn't end up in debug output #9086
* docs(connection+index): add serverSelectionTimeoutMS and heartbeatFrequencyMS to `connect()` and `openUri()` options #9071
* docs(geojson): add notes about geojson 2dsphere indexes #9044
* docs: make active page bold in navbar #9062
* docs: correct a typo in a code snippet #9089 [Elvis-Sarfo](https://github.com/Elvis-Sarfo)

5.9.17 / 2020-06-02
===================
* fix(document): avoid tracking changes like `splice()` on slice()-ed arrays #9011
* fix(populate): make populating a nested path a no-op #9073
* fix(document): clear nested cast errors when overwriting an array path #9080
* fix: upgrade mongodb to v3.5.8 #9069 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
* docs(document): add validateModifiedOnly to Document#save(), Document#validateSync() and Document#validate() #9078 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
* docs(faq): fix typo #9075 [tigransimonyan](https://github.com/tigransimonyan)
* docs: document all parameters to .debug #9029 [dandv](https://github.com/dandv)
* docs: fix property value in Getters example #9061 [ismet](https://github.com/ismet)

5.9.16 / 2020-05-25
===================
* perf(error): convert errors to classes extending Error for lower CPU overhead #9021 [zbjornson](https://github.com/zbjornson)
* fix(query): throw CastError if filter `$and`, `$or`, `$nor` contain non-object values #8948
* fix(bulkwrite): cast filter & update to schema after applying timestamps #9030 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
* fix(document): don't overwrite defaults with undefined keys in nested documents #9039 [vitorhnn](https://github.com/vitorhnn)
* fix(discriminator): remove discriminator schema nested paths pulled from base schema underneath a mixed path in discriminator schema #9042
* fix(model): make syncIndexes() not drop index if all user-specified collation options are the same #8994
* fix(document): make internal `$__.scope` property a symbol instead to work around a bug with fast-safe-stringify #8955
* docs: model.findByIdAndUpdate() 'new' param fix #9026 [dandv](https://github.com/dandv)

5.9.15 / 2020-05-18
===================
* fix(schema): treat creating dotted path with no parent as creating a nested path #9020
* fix(documentarray): make sure you can call `unshift()` after `map()` #9012 [philippejer](https://github.com/philippejer)
* fix(model): cast bulkwrite according to discriminator schema if discriminator key is present #8982 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
* fix(schema): remove `db` from reserved keywords #8940
* fix(populate): treat populating a doc array that doesn't have a `ref` as a no-op #8946
* fix(timestamps): set createdAt and updatedAt on doubly nested subdocs when upserting #8894
* fix(model): allow POJOs as schemas for model.discriminator(...) #8991 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
* fix(model): report `insertedDocs` on `insertMany()` errors #8938
* fix(model): ensure consistent `writeErrors` property on insertMany error with `ordered: false`, even if only one op failed #8938
* docs: add anchor tag to strictQuery and strict #9014 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
* docs(faq): remove faq ipv6 #9004
* docs: add note about throwing error only after validation and fix broken reference to api/CastError #8993 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
* docs: fix typos in documents.pug #9005 [dandv](https://github.com/dandv)

5.9.14 / 2020-05-13
===================
* fix(cursor): add index as second parameter to eachAsync callback #8972 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
Expand Down
4 changes: 4 additions & 0 deletions docs/acquit.pug
@@ -1,6 +1,10 @@
extends layout

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

ul.toc
each block in acquitBlocks[0].blocks
li
Expand Down
10 changes: 7 additions & 3 deletions docs/api.pug
Expand Up @@ -29,9 +29,13 @@ block content

each item in docs
hr.separate-api
h2(id=item.name, class="item-header")
a(href='#' + item.name)
| #{item.name}
div.item-header-wrap
<a class="edit-docs-link" href="#{item.editLink}">
<img src="/docs/images/pencil.svg" />
</a>
h2(id=item.name, class="item-header")
a(href='#' + item.name)
| #{item.name}
ul
each prop in item.props
li
Expand Down
3 changes: 3 additions & 0 deletions docs/api_split.pug
Expand Up @@ -15,6 +15,9 @@ append style
}

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>
h1 #{name}

div.
Expand Down
4 changes: 4 additions & 0 deletions docs/async-await.pug
Expand Up @@ -5,6 +5,10 @@ append style
script(type="text/javascript" src="/docs/js/native.js")

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

:markdown
## Async/Await

Expand Down
4 changes: 4 additions & 0 deletions docs/browser.pug
Expand Up @@ -5,6 +5,10 @@ block append style
script(type="text/javascript" src="/docs/js/native.js")

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

:markdown
<h1>Mongoose in the Browser</h1>

Expand Down
4 changes: 4 additions & 0 deletions docs/built-with-mongoose.pug
@@ -1,6 +1,10 @@
extends layout

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

:markdown
## Built With Mongoose

Expand Down
4 changes: 4 additions & 0 deletions docs/compatibility.pug
Expand Up @@ -5,6 +5,10 @@ append style
script(type="text/javascript" src="/docs/js/native.js")

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

:markdown
## MongoDB Server Version Compatibility

Expand Down
4 changes: 4 additions & 0 deletions docs/connections.pug
Expand Up @@ -5,6 +5,10 @@ append style
script(type="text/javascript" src="/docs/js/native.js")

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

:markdown
<h2><a href="#connections">Connections</a></h2>

Expand Down
4 changes: 4 additions & 0 deletions docs/css/api.css
Expand Up @@ -42,6 +42,10 @@
list-style-type: none;
}

.item-header-wrap {
position: relative;
}

@media (max-width: 1785px) {
.api-nav {
display: none;
Expand Down
23 changes: 23 additions & 0 deletions docs/css/mongoose5.css
Expand Up @@ -177,6 +177,25 @@ pre {
margin-top: 5px;
}

.edit-docs-link {
position: absolute;
top: 0.125em;
right: 0px;
background-color: #fafafa;
border: 1px solid #ddd;
padding: 5px;
padding-bottom: 0px;
border-radius: 3px;
}

.edit-docs-link img {
width: 1.25em;
}

.pure-menu-link.selected {
font-weight: bold;
}

/* Mobile */

#mobile-menu {
Expand Down Expand Up @@ -280,6 +299,10 @@ pre {
.active {
display: block !important;
}

.edit-docs-link {
display: none;
}
}

.pure-menu-item:last-of-type {
Expand Down
4 changes: 4 additions & 0 deletions docs/deprecations.pug
Expand Up @@ -5,6 +5,10 @@ append style
script(type="text/javascript" src="/docs/js/native.js")

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

:markdown
## Deprecation Warnings

Expand Down
4 changes: 4 additions & 0 deletions docs/documents.pug
Expand Up @@ -5,6 +5,10 @@ append style
script(type="text/javascript" src="/docs/js/native.js")

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

:markdown
## Documents

Expand Down
5 changes: 4 additions & 1 deletion docs/faq.pug
Expand Up @@ -17,6 +17,10 @@ block append style
}

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

:markdown
## FAQ

Expand Down Expand Up @@ -113,7 +117,6 @@ block content
// when the indexes have finished building successfully. The `init()`
// function is idempotent, so don't worry about triggering an index rebuild.
Model.init().then(function() {
assert.ifError(err);
Model.create([{ name: 'Val' }, { name: 'Val' }], function(err) {
console.log(err);
});
Expand Down
4 changes: 4 additions & 0 deletions docs/further_reading.pug
Expand Up @@ -21,6 +21,10 @@ append style
}

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

:markdown
## Further Reading

Expand Down
25 changes: 25 additions & 0 deletions docs/geojson.pug
Expand Up @@ -5,6 +5,10 @@ block append style
script(type="text/javascript" src="/docs/js/native.js")

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

:markdown
# Using GeoJSON

Expand Down Expand Up @@ -145,3 +149,24 @@ block content
```javascript
[require:geojson.*within helper]
```

<h2 id="geospatial-indexes">Geospatial Indexes</h2>

MongoDB supports [2dsphere indexes](https://docs.mongodb.com/manual/core/2dsphere/)
for speeding up geospatial queries. Here's how you can define
a 2dsphere index on a GeoJSON point:

```javascript
[require:geojson.*index$]
```

You can also define a geospatial index using the [`Schema#index()` function](/docs/api/schema.html#schema_Schema-index)
as shown below.

```javascript
citySchema.index({ location: '2dsphere' });
```

MongoDB's [`$near` query operator](https://docs.mongodb.com/v4.0/reference/operator/query/near/#op._S_near)
and [`$geoNear` aggregation stage](https://docs.mongodb.com/manual/reference/operator/aggregation/geoNear/#pipe._S_geoNear)
_require_ a 2dsphere index.
10 changes: 7 additions & 3 deletions docs/guide.pug
Expand Up @@ -5,6 +5,10 @@ append style
script(type="text/javascript" src="/docs/js/native.js")

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

:markdown
## Schemas

Expand Down Expand Up @@ -688,7 +692,7 @@ block content
_Note that Mongoose does not send the `shardcollection` command for you. You
must configure your shards yourself._

<h3 id="strict">option: strict</h3>
<h3 id="strict"><a href="#strict">option: strict</a></h3>

The strict option, (enabled by default), ensures that values passed to our
model constructor that were not specified in our schema do not get saved to
Expand Down Expand Up @@ -739,7 +743,7 @@ block content
thing.save(); // iAmNotInTheSchema is never saved to the db
```

<h3 id="strictQuery">option: strictQuery</h3>
<h3 id="strictQuery"><a href="#strictQuery">option: strictQuery</a></h3>

For backwards compatibility, the `strict` option does **not** apply to
the `filter` parameter for queries.
Expand Down Expand Up @@ -853,7 +857,7 @@ block content
var schema = new Schema({ name: String });
schema.set('validateBeforeSave', false);
schema.path('name').validate(function (value) {
return v != null;
return value != null;
});
var M = mongoose.model('Person', schema);
var m = new M({ name: null });
Expand Down
4 changes: 4 additions & 0 deletions docs/guides.pug
Expand Up @@ -5,6 +5,10 @@ block append style
script(type="text/javascript" src="/docs/js/native.js")

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

:markdown
## Guides

Expand Down
5 changes: 5 additions & 0 deletions docs/images/pencil.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/jest.pug
Expand Up @@ -5,6 +5,10 @@ block append style
script(type="text/javascript" src="/docs/js/native.js")

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

:markdown
# Testing Mongoose with [Jest](https://www.npmjs.com/package/jest)

Expand Down
4 changes: 4 additions & 0 deletions docs/lambda.pug
Expand Up @@ -5,6 +5,10 @@ block append style
script(type="text/javascript" src="/docs/js/native.js")

block content
<a class="edit-docs-link" href="#{editLink}">
<img src="/docs/images/pencil.svg" />
</a>

h2 Using Mongoose With AWS Lambda
:markdown
<script>
Expand Down

0 comments on commit 0e0b8fa

Please sign in to comment.