Skip to content

Commit

Permalink
avoid mongo exceptions on urls too long to be indexed
Browse files Browse the repository at this point in the history
  • Loading branch information
boogheta committed Mar 11, 2022
1 parent 253cd9e commit 652dafa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ sudo apt-get install -y mongodb-org
sudo service mongod restart
```

In order to avoid very rare issues with crazy long urls found by the crawler on the web, the following setting should be set onto mongo globally:

```bash
mongo --eval "db.getSiblingDB('admin').runCommand( { setParameter: 1, failIndexKeyTooLong: false } )"
```

For development and administrative use, you can also optionally install one of the following projects to easily access and manage MongoDB's databases:
- [RockMongo](http://rockmongo.com/wiki/installation?lang=en_us): a PHP web admin interface
- [RoboMongo](http://robomongo.org/): a shell-centric GUI
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ services:
image: mongo:3.6
volumes:
- ${DATA_PATH}mongo-data:/data/db
command: mongod --setParameter failIndexKeyTooLong=false --smallfiles

0 comments on commit 652dafa

Please sign in to comment.