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: 5.10.2
Choose a base ref
...
head repository: Automattic/mongoose
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5.13.20
Choose a head ref
Loading
Showing 356 changed files with 24,957 additions and 31,550 deletions.
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,9 @@
**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 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?**

60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test
on:
pull_request:
push:
jobs:
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
node: [4, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16]
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 }}

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

- 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
24 changes: 21 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ benchmarks/benchmarks
benchmarks/benchmarks2
benchmarks/benchmarks3
benchmarks/v8.log
benchmarks/typescript/**/*.js
.DS_Store
docs/*.json
docs/source/_docs
@@ -34,12 +35,29 @@ tools/31*

*.key

docs/*.html

# Webpack output
dist
test/files/main.js

package-lock.json

.config*
.config.js

# Compiled docs
docs/*.html
docs/tutorials/*.html
docs/typescript/*.html
docs/api/*.html
index.html

# Local Netlify folder
.netlify

# yarn package-lock
yarn.lock

# npm pack output
mongoose.tgz
mongoose-*.tgz

examples/ecommerce-netlify-functions/.netlify/state.json
5 changes: 4 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ examples/
.vscode
.eslintignore
CONTRIBUTING.md
HISTORY.md
History.*
format_deps.js
release-items.md
static.js
@@ -34,3 +34,6 @@ website.js

migrating_to_5.md
renovate.json
.travis.yml
webpack.config.js
webpack.base.config.js
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

22 changes: 8 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -6,22 +6,21 @@ If you have a question about Mongoose (not a bug report) please post it to eithe

- 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.
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, etc.
- 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
- 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 or typescript. Please write your bug reports in JavaScript that can run in vanilla Node.js_.
- _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
@@ -37,7 +36,7 @@ If you have a question about Mongoose (not a bug report) please post it to eithe
### Running the tests
- Open a terminal and navigate to the root of the project
- execute `npm install` to install the necessary dependencies
- start a mongodb instance on port 27017 if one isn't running already. `mongod --dbpath <path to store data> --port 27017 --storageEngine mmapv1`. Mongoose tests run much faster on the mmapv1 storage engine as opposed to the WiredTiger storage engine.
- 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>`
@@ -51,11 +50,12 @@ To contribute to the [guide](http://mongoosejs.com/docs/guide.html) or [quick st

If you'd like to preview your documentation changes, first commit your changes to your local master branch, then execute:

* `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 commiting, because changes to `docs/*` should **not** be in PRs.
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

@@ -83,9 +83,3 @@ Thank you to all our backers! [[Become a backer](https://opencollective.com/mong

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


### Sponsors

Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/mongoose#sponsor))

<a href="https://mixmax.com" target="_blank"><img src="http://mongoosejs.com/docs/images/mixmax.png"></a>
Loading