Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Automattic/mongoose
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: de88912969017e20cda78a3b98dac27caa781bf1
Choose a base ref
...
head repository: Automattic/mongoose
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f8d2721567ef3f0811cf591649e70bea20db68b4
Choose a head ref

Commits on Nov 10, 2015

  1. now working on 4.2.6

    vkarpov15 committed Nov 10, 2015
    Copy the full SHA
    9c048d2 View commit details
  2. Copy the full SHA
    e863c10 View commit details
  3. Merge pull request #3559 from amaurymedeiros/patch-2

    Minor grammar fix in populate documentation
    vkarpov15 committed Nov 10, 2015
    Copy the full SHA
    ffb48a7 View commit details
  4. repro; #3560

    vkarpov15 committed Nov 10, 2015
    Copy the full SHA
    d76fe3d View commit details
  5. Copy the full SHA
    6a43162 View commit details
  6. Copy the full SHA
    97fea34 View commit details
  7. repro; #3562

    vkarpov15 committed Nov 10, 2015
    Copy the full SHA
    79797da View commit details
  8. Copy the full SHA
    edd28b4 View commit details
  9. Fix issue encountered with custom id type that contains a buffer

    modifiedPaths() walks the object structure, encounters the Buffer, then
    encounters the parent of the buffer, which hangs the server for up to 30
    seconds.
    johnpeb committed Nov 10, 2015
    Copy the full SHA
    36f2135 View commit details

Commits on Nov 11, 2015

  1. repro; #3564

    vkarpov15 committed Nov 11, 2015
    Copy the full SHA
    5151c83 View commit details
  2. Copy the full SHA
    4b15d39 View commit details

Commits on Nov 13, 2015

  1. Copy the full SHA
    0fe9864 View commit details

Commits on Nov 14, 2015

  1. Copy the full SHA
    a57b1f1 View commit details
  2. Merge branch '4.1.11.1' of git://github.com/johnpeb/mongoose

    Conflicts:
    	lib/services/updateValidators.js
    vkarpov15 committed Nov 14, 2015
    Copy the full SHA
    a499e0c View commit details
  3. Copy the full SHA
    f78e398 View commit details
  4. repro; #2321

    vkarpov15 committed Nov 14, 2015
    Copy the full SHA
    23ff015 View commit details
  5. Copy the full SHA
    168f516 View commit details
  6. now working on 3.8.37

    vkarpov15 committed Nov 14, 2015
    Copy the full SHA
    19c801f View commit details
  7. Copy the full SHA
    a787cc1 View commit details

Commits on Nov 16, 2015

  1. repro; #3575

    vkarpov15 committed Nov 16, 2015
    Copy the full SHA
    6e18155 View commit details
  2. Copy the full SHA
    47f6806 View commit details
  3. Copy the full SHA
    f6ba770 View commit details
  4. release 3.8.37

    vkarpov15 committed Nov 16, 2015
    Copy the full SHA
    2bb356c View commit details
  5. Merge branch '3.8.x'

    Conflicts:
    	History.md
    	lib/query.js
    	package.json
    vkarpov15 committed Nov 16, 2015
    Copy the full SHA
    913f943 View commit details
  6. release 4.2.6

    vkarpov15 committed Nov 16, 2015
    Copy the full SHA
    cefe662 View commit details

Commits on Nov 17, 2015

  1. now working on 4.2.7

    vkarpov15 committed Nov 17, 2015
    Copy the full SHA
    4eec954 View commit details
  2. repro; #3579

    vkarpov15 committed Nov 17, 2015
    Copy the full SHA
    3ec1911 View commit details
  3. Copy the full SHA
    78fa27f View commit details

Commits on Nov 18, 2015

  1. repro; #3580 part 1

    vkarpov15 committed Nov 18, 2015
    Copy the full SHA
    62a8fee View commit details
  2. Copy the full SHA
    1e6047b View commit details

Commits on Nov 19, 2015

  1. docs; clarify param projection in findOne

    1. Short link removed because it's a duplicate of `@see findOne`.
    2. `@see Query.select` added because of its relation to the `projection` argument.
    
    Thank you!
    gunar committed Nov 19, 2015
    Copy the full SHA
    da20549 View commit details
  2. Merge pull request #3593 from gunar/patch-1

    docs; clarify param projection in findOne
    vkarpov15 committed Nov 19, 2015
    Copy the full SHA
    65a6bdf View commit details
  3. repro; #3594

    vkarpov15 committed Nov 19, 2015
    Copy the full SHA
    a66a8ce View commit details
  4. Copy the full SHA
    2c9199c View commit details
  5. Copy the full SHA
    555b3dd View commit details
  6. Copy the full SHA
    3f413c8 View commit details
  7. Merge pull request #3597 from stcruy/patch-1

    Add FAQ entry: OverwriteModelError
    vkarpov15 committed Nov 19, 2015
    Copy the full SHA
    b4d915f View commit details
  8. docs; clarify #3597

    vkarpov15 committed Nov 19, 2015
    Copy the full SHA
    1f67c74 View commit details

Commits on Nov 20, 2015

  1. Copy the full SHA
    6c98eb4 View commit details
  2. repro; #3589

    vkarpov15 committed Nov 20, 2015
    Copy the full SHA
    a26d188 View commit details
  3. Copy the full SHA
    df7a5dc View commit details
  4. Copy the full SHA
    bf30909 View commit details
  5. Copy the full SHA
    279c36f View commit details
  6. repro; #3596

    vkarpov15 committed Nov 20, 2015
    Copy the full SHA
    8f14b01 View commit details
  7. Copy the full SHA
    3f2ebba View commit details
  8. release 4.2.7

    vkarpov15 committed Nov 20, 2015
    Copy the full SHA
    f708091 View commit details

Commits on Nov 21, 2015

  1. Now working on 4.2.8

    vkarpov15 committed Nov 21, 2015
    Copy the full SHA
    3fa4cd3 View commit details
  2. lint

    Update Eslint
    Rename .eslintrc to .eslintrc.yml
    Update code style in README.md
    Update lint warnings
    ChristianMurphy committed Nov 21, 2015
    Copy the full SHA
    7c60ca4 View commit details
  3. Copy the full SHA
    9fa6bff View commit details
  4. repro; #3601

    vkarpov15 committed Nov 21, 2015
    Copy the full SHA
    66b085b View commit details
Showing 817 changed files with 128,202 additions and 90,903 deletions.
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
docs/
bin/
test/triage/
tools/
test/es-next/
test/files/
dist/
benchmarks/

search.js
31 changes: 0 additions & 31 deletions .eslintrc

This file was deleted.

5 changes: 5 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# These are supported funding model platforms

github: vkarpov15
open_collective: mongoose
tidelift: npm/mongoose
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- *Before creating an issue please make sure you are using the latest version of mongoose -->

**Do you want to request a *feature* or report a *bug*?**

**What is the current behavior?**

**If the current behavior is a bug, please provide the steps to reproduce.**
<!-- If you can, provide a standalone script / gist to reproduce your issue. -->

<!-- If you are using TypeScript, please include your `tsconfig.json` -->

**What is the expected behavior?**

**What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.**

<!-- You can print `mongoose.version` to get your current version of Mongoose: https://mongoosejs.com/docs/api.html#mongoose_Mongoose-version -->
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory.

If you're making a change to documentation, do **not** modify a `.html` file directly. Instead find the corresponding `.pug` file or test case in the `test/docs` directory.

**Summary**

<!-- Explain the **motivation** for making this change. What problem does the pull request solve? -->

**Examples**

<!-- If this code fixes a bug or adds a new feature, provide an example demonstrating the change, unless you added a test. -->
56 changes: 56 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Test
on:
pull_request:
push:
jobs:
test:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
node: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Upgrade Node 5 npm
run: npm install -g npm@3
if: ${{ matrix.node == 5 }}

- run: npm install

- name: Setup
run: |
wget -q http://downloads.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.0.2.tgz
tar xf mongodb-linux-x86_64-ubuntu1804-4.0.2.tgz
mkdir -p ./data/db/27017 ./data/db/27000
printf "\n--timeout 8000" >> ./test/mocha.opts
./mongodb-linux-x86_64-ubuntu1804-4.0.2/bin/mongod --fork --dbpath ./data/db/27017 --syslog --port 27017
sleep 2
mongod --version
mkdir ./test/typescript/node_modules
ln -s `pwd` ./test/typescript/node_modules/mongoose
echo `pwd`/mongodb-linux-x86_64-ubuntu1804-4.0.2/bin >> $GITHUB_PATH
- run: npm test

lint:
runs-on: ubuntu-latest
name: Linter
steps:
- uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 14

- run: npm install

- name: Linter
run: npm run lint
22 changes: 20 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lib-cov
**.swp
*.swp
*.sw*
node_modules/
*.orig
@@ -10,18 +10,36 @@ benchmarks/v8.log
.DS_Store
docs/*.json
docs/source/_docs
docs/*.html
tags
test/triage/*.js
/.idea
/inspections
bin/mongoose.min.js
coverage
npm-debug.log
data/
.nyc_output/

tools/31*

# Visual Studio
# =========
*.suo
*.ntvs*
*.njsproj
*.sln

# Visual Studio Code
.vscode

*.key

docs/*.html

# Webpack output
dist
test/files/main.js

package-lock.json

.config*
27 changes: 25 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -10,7 +10,30 @@ test/
Makefile
CNAME
index.html
index.jade
index.pug
bin/
karma.*.js
tools/31*
*.key
data/

*.txt
*.png

examples/
.github
.vscode
.eslintignore
CONTRIBUTING.md
History.*
format_deps.js
release-items.md
static.js
website.js

.config*

migrating_to_5.md
renovate.json
.travis.yml
webpack.config.js
webpack.base.config.js
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

75 changes: 51 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,85 @@
## Contributing to Mongoose

If you have a question about Mongoose (not a bug report) please post it to either [StackOverflow](http://stackoverflow.com/questions/tagged/mongoose), our [Google Group](http://groups.google.com/group/mongoose-orm), or on the #mongoosejs irc channel on freenode.
If you have a question about Mongoose (not a bug report) please post it to either [StackOverflow](http://stackoverflow.com/questions/tagged/mongoose), or on [Gitter](https://gitter.im/Automattic/mongoose?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

### Reporting bugs

- Before opening a new issue, look for existing [issues](https://github.com/learnboost/mongoose/issues) to avoid duplication. If the issue does not yet exist, [create one](https://github.com/learnboost/mongoose/issues/new).
- Please describe the issue you are experiencing, along with any associated stack trace.
- Please post code that reproduces the issue, the version of mongoose, node version, and mongodb version.
- _The source of this project is written in javascript, not coffeescript, therefore your bug reports should be written in javascript_.
- In general, adding a "+1" comment to an existing issue does little to help get it resolved. A better way is to submit a well documented pull request with clean code and passing tests.
- Before opening a new issue, look for existing [issues](https://github.com/Automattic/mongoose/issues) to avoid duplication. If the issue does not yet exist, [create one](https://github.com/Automattic/mongoose/issues/new).
- Please post any relevant code samples, preferably a standalone script that
reproduces your issue. Do **not** describe your issue in prose. **Show your code.**
- If the bug involves an error, please post the stack trace.
- Please post the version of Mongoose and MongoDB that you're using.
 - Please write bug reports in JavaScript (ES5, ES6, etc) that runs in Node.js, **not** CoffeeScript, TypeScript, JSX, etc.

### Requesting new features

- Before opening a new issue, look for existing [issues](https://github.com/learnboost/mongoose/issues) to avoid duplication. If the issue does not yet exist, [create one](https://github.com/learnboost/mongoose/issues/new).
- Please describe a use case for it
- it would be ideal to include test cases as well
- In general, adding a "+1" comment to an existing issue does little to help get it resolved. A better way is to submit a well documented pull request with clean code and passing tests.
- Please include test cases if possible

### Fixing bugs / Adding features

- Before starting to write code, look for existing [issues](https://github.com/learnboost/mongoose/issues). That way you avoid working on something that might not be of interest or that has been addressed already in a different branch. You can create a new issue [here](https://github.com/learnboost/mongoose/issues/new).
- _The source of this project is written in javascript, not coffeescript, therefore your bug reports should be written in javascript_.
- Fork the [repo](https://github.com/learnboost/mongoose) _or_ for small documentation changes, navigate to the source on github and click the [Edit](https://github.com/blog/844-forking-with-the-edit-button) button.
- _The source of this project is written in JavaScript, not CoffeeScript or TypeScript. Please write your bug reports in JavaScript that can run in vanilla Node.js_.
- Fork the [repo](https://github.com/Automattic/mongoose) _or_ for small documentation changes, navigate to the source on github and click the [Edit](https://github.com/blog/844-forking-with-the-edit-button) button.
- Follow the general coding style of the rest of the project:
- 2 space tabs
- no trailing whitespace
- comma first
- inline documentation for new methods, class members, etc
- 1 space between conditionals/functions, and their parenthesis and curly braces
- inline documentation for new methods, class members, etc.
- 1 space between conditionals, no space before function parenthesis
- `if (..) {`
- `for (..) {`
- `while (..) {`
- `function (err) {`
- Write tests and make sure they pass (tests are in the [test](https://github.com/LearnBoost/mongoose/tree/master/test) directory).
- `function(err) {`
- Write tests and make sure they pass (tests are in the [test](https://github.com/Automattic/mongoose/tree/master/test) directory).

### Running the tests
- Open a terminal and navigate to the root of the project
- execute `npm install` to install the necessary dependencies
- execute `make test` to run the tests (we're using [mocha](http://visionmedia.github.com/mocha/))
- or to execute a single test `T="-g 'some regexp that matches the test description'" make test`
- any mocha flags can be specified with `T="..."`
- start a MongoDB instance on port 27017 if one isn't running already. `mongod --dbpath <path to store data>`. We typically use [MongoDB Enterprise](https://www.mongodb.com/try/download/enterprise) with the [in-memory storage engine](https://docs.mongodb.com/manual/core/inmemory/) in order to run tests faster.
- execute `npm test` to run the tests (we're using [mocha](http://mochajs.org/))
- or to execute a single test `npm test -- -g 'some regexp that matches the test description'`
- any mocha flags can be specified with `-- <mocha flags here>`
- For example, you can use `npm test -- -R spec` to use the spec reporter, rather than the dot reporter (by default, the test output looks like a bunch of dots)

### Documentation

To contribute to the [API documentation](http://mongoosejs.com/docs/api.html) just make your changes to the inline documentation of the appropriate [source code](https://github.com/LearnBoost/mongoose/tree/master/lib) in the master branch and submit a [pull request](https://help.github.com/articles/using-pull-requests/). You might also use the github [Edit](https://github.com/blog/844-forking-with-the-edit-button) button.
To contribute to the [API documentation](http://mongoosejs.com/docs/api.html) just make your changes to the inline documentation of the appropriate [source code](https://github.com/Automattic/mongoose/tree/master/lib) in the master branch and submit a [pull request](https://help.github.com/articles/using-pull-requests/). You might also use the github [Edit](https://github.com/blog/844-forking-with-the-edit-button) button.

To contribute to the [guide](http://mongoosejs.com/docs/guide.html) or [quick start](http://mongoosejs.com/docs/index.html) docs, make your changes to the appropriate `.pug` files in the [docs](https://github.com/Automattic/mongoose/tree/master/docs) directory of the master branch and submit a pull request. Again, the [Edit](https://github.com/blog/844-forking-with-the-edit-button) button might work for you here.

To contribute to the [guide](http://mongoosejs.com/docs/guide.html) or [quick start](http://mongoosejs.com/docs/index.html) docs, make your changes to the appropriate `.jade` files in the [docs](https://github.com/LearnBoost/mongoose/tree/master/docs) directory of the master branch and submit a pull request. Again, the [Edit](https://github.com/blog/844-forking-with-the-edit-button) button might work for you here.
If you'd like to preview your documentation changes, first commit your changes to your local master branch, then execute:

If you'd like to preview your documentation changes, first commit your changes to your local master branch, then execute `make docs` from the project root, which switches to the gh-pages branch, merges from the master branch and builds all the static pages for you. Now execute `node static.js` from the project root which will launch a local webserver where you can browse the documentation site locally. If all looks good, submit a [pull request](https://help.github.com/articles/using-pull-requests/) to the master branch with your changes.
* `npm install`
* `make docclean`
* `make gendocs`
* `node static.js`

Visit `http://localhost:8088` and you should see the docs with your local changes. Make sure you `git reset --hard` before committing, because changes to `docs/*` should **not** be in PRs.

### Plugins website

The [plugins](http://plugins.mongoosejs.com/) site is also an [open source project](https://github.com/aheckmann/mongooseplugins) that you can get involved with. Feel free to fork and improve it as well!
The [plugins](http://plugins.mongoosejs.io/) site is also an [open source project](https://github.com/vkarpov15/mongooseplugins) that you can get involved with. Feel free to fork and improve it as well!


## Financial contributions

We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/mongoose).
Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed.


## Credits


### Contributors

Thank you to all the people who have already contributed to mongoose!
<a href="https://github.com/Automattic/mongoose/graphs/contributors"><img src="https://opencollective.com/mongoose/contributors.svg?width=890" /></a>


### Backers

Thank you to all our backers! [[Become a backer](https://opencollective.com/mongoose#backer)]

### Sharing your projects
<a href="https://opencollective.com/mongoose#backers" target="_blank"><img src="https://opencollective.com/mongoose/backers.svg?width=890"></a>

All are welcome to share their creations which use mongoose on our [tumbler](http://mongoosejs.tumblr.com/). Just fill out the [simple submission form](http://mongoosejs.tumblr.com/submit).
Loading