#7380·sails

Add new config key directConnection to whitelist in sails-mongo

Author: romualdnaveCreated Jun 30, 2026Updated Sep 7, 2026

Node version: 18.20.3 Sails version (sails): - (NestJS App) ORM hook version (sails-hook-orm): - Sockets hook version (sails-hook-sockets): - Organics hook version (sails-hook-organics): - Grunt hook version (sails-hook-grunt): - Uploads hook version (sails-hook-uploads): - DB adapter & version (e.g. [email protected]): "sails-mongo": "2.1.2" Skipper adapter & version (e.g. [email protected]): - mongodb version : "mongodb": "7.0.28"

First I want to thank you very much for updating sails-mongo ❤

Here is the problem : Error happen when server is starting as we are trying to work with MongoDB change streams in a replica set configuration.

[Nest] 269955   - 30/06/2026, 9:29:03 AM   Invalid configuration for datastore `mongo`:  Unrecognized options (`directConnection`) specified as config overrides.
This adapter expects only whitelisted properties.
--
See http://sailsjs.com/config/datastores#?the-connection-url for info,
or visit https://sailsjs.com/support for more help. +132ms
Error: Invalid configuration for datastore `mongo`:  Unrecognized options (`directConnection`) specified as config overrides.
This adapter expects only whitelisted properties.
--
See http://sailsjs.com/config/datastores#?the-connection-url for info,
...

@DominusKelvin We have already opened a PR to address this issue => https://github.com/balderdashy/sails-mongo/pull/505

Thank you and regards