Skip to content

Commit 9ca85d3

Browse files
Merge pull request #215317 from seesharprun/cosmos-mongoose-version-specify
Cosmos DB | Mention mongoose & API for MongoDB incompatibility
2 parents 8d218e6 + 2d8d8cb commit 9ca85d3

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

articles/cosmos-db/mongodb/connect-using-mongoose.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ After you create the database, you'll use the name in the `COSMOSDB_DBNAME` envi
5656

5757
3. Install the necessary packages using one of the ```npm install``` options:
5858

59-
* Mongoose: ```npm install mongoose@5 --save```
59+
* **Mongoose**: ```npm install mongoose@5.13.15 --save```
6060

61-
> [!Note]
62-
> The Mongoose example connection below is based on Mongoose 5+, which has changed since earlier versions.
61+
> [!IMPORTANT]
62+
> The Mongoose example connection below is based on Mongoose 5+, which has changed since earlier versions. Azure Cosmos DB for MongoDB is compatible with up to version `5.13.15` of Mongoose. For more information, please see the [issue discussion](https://github.com/Automattic/mongoose/issues/11072) in the Mongoose GitHub repository.
6363
64-
* Dotenv (if you'd like to load your secrets from an .env file): ```npm install dotenv --save```
64+
* **Dotenv** *(if you'd like to load your secrets from an .env file)*: ```npm install dotenv --save```
6565

6666
>[!Note]
6767
> The ```--save``` flag adds the dependency to the package.json file.

articles/cosmos-db/mongodb/tutorial-develop-nodejs-part-5.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@ Mongoose is an object data modeling (ODM) library for MongoDB and Node.js. You c
4444
1. Install the mongoose npm module, which is an API that's used to talk to MongoDB.
4545

4646
```bash
47-
npm i mongoose --save
47+
npm install mongoose@5.13.15 --save
4848
```
4949

50+
> [!IMPORTANT]
51+
> Azure Cosmos DB for MongoDB is compatible with up to version `5.13.15` of Mongoose. For more information, please see the [issue discussion](https://github.com/Automattic/mongoose/issues/11072) in the Mongoose GitHub repository.
52+
5053
1. In the **server** folder, create a file named **mongo.js**. You'll add the connection details of your Azure Cosmos DB account to this file.
5154
5255
1. Copy the following code into the **mongo.js** file. The code provides the following functionality:

0 commit comments

Comments
 (0)