<commit_before># V4 migration guide

To migrate the library from V3 to V4, re-install the dependencies.

If you are using `npm`

```
npm uninstall connect-mongo
npm uninstall @types/connect-mongo
npm install connect-mongo
```

If you are using `yarn`

```
yarn remove connect-mongo
yarn remove @types/connect-mongo
yarn add connect-mongo
```

Next step is to import the dependencies

Javascript:
```js
const MongoStore = require('connect-mongo').default;
```

Typescript:
```ts
import MongoStore from 'connect-mongo';
```

Create the store using `MongoStore.create({options})` instead of `new MongoStore({options})`

```js
app.use(session({
  secret: 'foo',
  store: MongoStore.create(options)
}));
```

For the options, you should make the following changes:

* Change `url` to `mongoUrl`
* Keep `clientPromise` if you are using it
* `mongooseConnection` & `clientPromise` have been removed. Please update your application code to use either `mongoUrl` or `clientPromise`
* Remove `autoRemove` & `autoRemoveInterval` option if your are using and check if you need to set the `createAutoRemoveIdx` option
* Remove `fallbackMemory` option and if you are using it, you can import from:

```js
const session = require('express-session');

app.use(session({
  store: isDev ? new session.MemoryStore() : MongoStore.create(options)
}));
```
<commit_msg>docs: migration guide add link point to example<commit_after># V4 migration guide

To migrate the library from V3 to V4, re-install the dependencies.

If you are using `npm`

```
npm uninstall connect-mongo
npm uninstall @types/connect-mongo
npm install connect-mongo
```

If you are using `yarn`

```
yarn remove connect-mongo
yarn remove @types/connect-mongo
yarn add connect-mongo
```

Next step is to import the dependencies

Javascript:
```js
const MongoStore = require('connect-mongo').default;
```

Typescript:
```ts
import MongoStore from 'connect-mongo';
```

Create the store using `MongoStore.create({options})` instead of `new MongoStore({options})`

```js
app.use(session({
  secret: 'foo',
  store: MongoStore.create(options)
}));
```

For the options, you should make the following changes:

* Change `url` to `mongoUrl`
* Keep `clientPromise` if you are using it
* `mongooseConnection` & `clientPromise` have been removed. Please update your application code to use either `mongoUrl` or `clientPromise`
* Remove `autoRemove` & `autoRemoveInterval` option if your are using and check if you need to set the `createAutoRemoveIdx` option
* Remove `fallbackMemory` option and if you are using it, you can import from:

```js
const session = require('express-session');

app.use(session({
  store: isDev ? new session.MemoryStore() : MongoStore.create(options)
}));
```

> You can also take a look at [example](example) directory for example usage.

{'fraction_non_alphanumeric': 0.1150694691841824, 'fraction_numerical': 0.0021375133594584966, 'mean_word_length': 5.198675496688741, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2705147', 'n_tokens_mistral': 881, 'n_tokens_neox': 836, 'n_words': 325}