Skip to content

Nexus 0.8.0

Choose a tag to compare

@RoodFruit RoodFruit released this 23 Nov 13:05
· 30 commits to main since this release
Immutable release. Only release title and notes can be modified.
fc5f560

Nexus 0.8.0: MongoDB

🍃 MongoDB as a service

MongoDB 7.0, 8.0 and 9.0 are services in Nexus now, next to MySQL, MariaDB and PostgreSQL. Install a version on the Packages screen. Nexus downloads the server from MongoDB.

  • Transactions work. Each MongoDB runs as a replica set of one server. So DB::transaction of Laravel and the nested writes of Prisma work.
  • No password by default, as for MySQL. The screen of the service sets a user and a password.
  • Your own mongod.conf, as for my.cnf and redis.conf.
  • MongoDB Tools. Nexus installs mongodump and mongorestore with the first MongoDB. They go with the last one.
  • Open in Compass. Settings > Databases > Open with chooses the app for a MongoDB database.

📥 Bring your data

  • Import an archive of mongodump --archive, with or without --gzip. The import sheet shows the databases and the collections of the file.
  • Copy from another server, for example from Docker or MongoDB Atlas. Give the URL in the import sheet, or use nexus db copy shop --from-url "<url>" --to mongodb-8.0.
  • The site sees its database. The Site screen shows the MongoDB connection of a Laravel site. "Use Nexus…" changes its URL to the MongoDB of Nexus.

🌳 Workspaces with MongoDB

Each workspace of a site with MongoDB gets its own MongoDB server, on a copy of your data. Nexus locks MongoDB for less than a second for the copy. A write waits and then continues.

  • Laravel: the URL in MONGODB_URI or DB_URI gets the port of the workspace. A host and a port in two keys work too.
  • Node.js: a MongoDB URL in the env files gets the server of the workspace, for example MONGODB_URI of mongoose.
  • A stopped workspace starts again at the first MongoDB connection, as for the other databases.
  • A removed workspace keeps a dump of its MongoDB databases in the trash. nexus db restore loads it again.
  • MongoDB Atlas (mongodb+srv) stays as it is. So such a workspace shares the Atlas database with the main site. A Laravel site shows Not isolated, and a Node.js app gets a warning.

🛠 Fixes

  • A failed download tries again. Each download of a package tries a second time before it fails.