Skip to content

Commit

Permalink
Merge pull request #1225 from FoalTS/v4-upgrade-db-dependencies
Browse files Browse the repository at this point in the history
Upgrade db dependencies for version 4
  • Loading branch information
LoicPoullain authored Sep 3, 2023
2 parents 5d8c39d + 78ad010 commit 1c0a979
Show file tree
Hide file tree
Showing 28 changed files with 1,058 additions and 1,079 deletions.
16 changes: 2 additions & 14 deletions docs/docs/authentication/session-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -1064,26 +1064,14 @@ async function main() {
#### `MongoDBStore`

```
npm install mongodb@4
npm install mongodb@5
```

> The `MongoDBStore` requires version 4 of the [mongodb](https://www.npmjs.com/package/mongodb) package. If you are using TypeORM with MongoDB, which requires version 3, you can have both versions coexist in your `package.json` as follows:
> ```json
> {
> "mongodb": "~3.7.3",
> "mongodb4": "npm:mongodb@~4.3.1",
> }
> ```
>
> ```typescript
> import { MongoClient } from 'mongodb4';
> ```
*index.ts*
```typescript
import { createApp, ServiceManager } from '@foal/core';
import { MongoDBStore } from '@foal/mongodb';
import { MongoClient } from 'mongodb'; // or from 'mongodb4';
import { MongoClient } from 'mongodb';

async function main() {
const mongoDBClient = await MongoClient.connect('mongodb://localhost:27017/db');
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/databases/typeorm/mongodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ foal createapp my-app --mongodb
## Configuration

```
npm install mongodb
npm install mongodb@5
```

<Tabs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1064,26 +1064,14 @@ async function main() {
#### `MongoDBStore`

```
npm install mongodb@4
npm install mongodb@5
```

> The `MongoDBStore` requires version 4 of the [mongodb](https://www.npmjs.com/package/mongodb) package. If you are using TypeORM with MongoDB, which requires version 3, you can have both versions coexist in your `package.json` as follows:
> ```json
> {
> "mongodb": "~3.7.3",
> "mongodb4": "npm:mongodb@~4.3.1",
> }
> ```
>
> ```typescript
> import { MongoClient } from 'mongodb4';
> ```
*index.ts*
```typescript
import { createApp, ServiceManager } from '@foal/core';
import { MongoDBStore } from '@foal/mongodb';
import { MongoClient } from 'mongodb'; // or from 'mongodb4';
import { MongoClient } from 'mongodb';

async function main() {
const mongoDBClient = await MongoClient.connect('mongodb://localhost:27017/db');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1064,26 +1064,14 @@ async function main() {
#### `MongoDBStore`

```
npm install mongodb@4
npm install mongodb@5
```

> The `MongoDBStore` requires version 4 of the [mongodb](https://www.npmjs.com/package/mongodb) package. If you are using TypeORM with MongoDB, which requires version 3, you can have both versions coexist in your `package.json` as follows:
> ```json
> {
> "mongodb": "~3.7.3",
> "mongodb4": "npm:mongodb@~4.3.1",
> }
> ```
>
> ```typescript
> import { MongoClient } from 'mongodb4';
> ```
*index.ts*
```typescript
import { createApp, ServiceManager } from '@foal/core';
import { MongoDBStore } from '@foal/mongodb';
import { MongoClient } from 'mongodb'; // or from 'mongodb4';
import { MongoClient } from 'mongodb';

async function main() {
const mongoDBClient = await MongoClient.connect('mongodb://localhost:27017/db');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1064,26 +1064,14 @@ async function main() {
#### `MongoDBStore`

```
npm install mongodb@4
npm install mongodb@5
```

> The `MongoDBStore` requires version 4 of the [mongodb](https://www.npmjs.com/package/mongodb) package. If you are using TypeORM with MongoDB, which requires version 3, you can have both versions coexist in your `package.json` as follows:
> ```json
> {
> "mongodb": "~3.7.3",
> "mongodb4": "npm:mongodb@~4.3.1",
> }
> ```
>
> ```typescript
> import { MongoClient } from 'mongodb4';
> ```
*index.ts*
```typescript
import { createApp, ServiceManager } from '@foal/core';
import { MongoDBStore } from '@foal/mongodb';
import { MongoClient } from 'mongodb'; // or from 'mongodb4';
import { MongoClient } from 'mongodb';

async function main() {
const mongoDBClient = await MongoClient.connect('mongodb://localhost:27017/db');
Expand Down
Loading

0 comments on commit 1c0a979

Please sign in to comment.