fix(curriculum): Changed Mongoose version to avoid warnings in boilerplate's Node console when working on Mongoose challenges (#47129)

* fix: changed mongoose version to avoid warnings in console

* fix: changed ~ to ^ for mongoose version

Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>

Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
This commit is contained in:
Randell Dawson 2022-08-02 23:36:13 -06:00 committed by GitHub
parent c17bd7cd89
commit 08ce28fba3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,7 @@ Follow <a href='https://www.freecodecamp.org/news/get-started-with-mongodb-atlas
# --instructions--
`mongodb@~3.6.0` and `mongoose@~5.4.0` have been added to your projects `package.json` file. First, require mongoose as `mongoose` in `myApp.js`. Next, create a `.env` file and add a `MONGO_URI` variable to it. Its value should be your MongoDB Atlas database URI. Be sure to surround the URI with single or double quotes, and remember that you can't use spaces around the `=` in environment variables. For example, `MONGO_URI='VALUE'`.
`mongoose@^5.11.15` has been added to your projects `package.json` file. First, require mongoose as `mongoose` in `myApp.js`. Next, create a `.env` file and add a `MONGO_URI` variable to it. Its value should be your MongoDB Atlas database URI. Be sure to surround the URI with single or double quotes, and remember that you can't use spaces around the `=` in environment variables. For example, `MONGO_URI='VALUE'`.
**Note:** If you are using Replit, you cannot create a `.env` file. Instead, use the built-in <dfn>SECRETS</dfn> tab to add the variable. <em>Do not</em> surround the values with quotes when using the <em>SECRETS</em> tab.
@ -34,27 +34,7 @@ mongoose.connect(<Your URI>, { useNewUrlParser: true, useUnifiedTopology: true }
# --hints--
"mongodb version ~3.6.0" dependency should be in package.json
```js
(getUserInput) =>
$.get(getUserInput('url') + '/_api/file/package.json').then(
(data) => {
var packJson = JSON.parse(data);
assert.property(packJson.dependencies, 'mongodb')
assert.match(
packJson.dependencies.mongodb,
/^\~3\.6\.0/,
'Wrong version of "mongodb". It should be ~3.6.0'
);
},
(xhr) => {
throw new Error(xhr.responseText);
}
);
```
"mongoose version ~5.4.0" dependency should be in package.json
"mongoose version ^5.11.15" dependency should be in package.json
```js
(getUserInput) =>
@ -64,8 +44,8 @@ mongoose.connect(<Your URI>, { useNewUrlParser: true, useUnifiedTopology: true }
assert.property(packJson.dependencies, 'mongoose');
assert.match(
packJson.dependencies.mongoose,
/^\~5\.4\.0/,
'Wrong version of "mongoose". It should be ~5.4.0'
/^\^5\.11\.15/,
'Wrong version of "mongoose". It should be ^5.11.15'
);
},
(xhr) => {