Files
openhab-addons/bundles/org.openhab.persistence.mongodb
Holger FriedrichandGitHub 8beefd56c6 [mongodb] Upgrade dependencies (#20725)
* Upgrade mongodb-client from 4.11.1 to 5.4.
* Upgrade test dependencies and helper libraries.

Not that this upgrade lifts the minmum database version to 4.0.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2026-05-16 11:20:33 +02:00
..

MongoDB Persistence

This service allows you to persist state updates using the MongoDB database. It supports writing information to a MongoDB document store, as well as querying from it.

Configuration

This service can be configured in the file services/mongodb.cfg.

Property Default Required Description
url Yes connection URL to address MongoDB. For example, mongodb://localhost:27017
database Yes database name
collection Yes Set collection to "" if it shall generate a collection per item

If you have a username and password, it looks like this: url = mongodb://[username]:[password]@[localhost]:27017/[database] The database is required: https://mongodb.github.io/mongo-java-driver/3.9/javadoc/com/mongodb/MongoClientURI.html

All item and event related configuration is done in the file persistence/mongodb.persist.