Any alternatives to sails-mongo adapter? According to Sails-Mongo Compatibility, sails-mongo only supports up to MongoDB 4.2.
Current issue I face is the below:
error: Sending 500 ("Server Error") response:
MongoError: Unsupported OP_QUERY command: find. The client driver may require an upgrade. For
more details see https://dochub.mongodb.org/core/legacy-opcode-removal
My package.json versions are
"sails-mongo":"^1.2.0",
"mongodb":"^5.2.0",
"connect-mongo":"^5.0.0",
"engines":{
"node":"14.x",
}
Here's what i get when i run npm list mongodb
├─┬ [email protected]
│ └── [email protected] deduped
├── [email protected]
└─┬ [email protected]
└── [email protected]
On sails.js you need to use different libs to support newer versions of mongodb driver. There is an issue about it. As
sails-mongois not being updated, and won't work with mongodb 6.0.I created a repo with the full solution: https://github.com/Goostavo/sails-mongodb-6
I'm using the following packages and files.
I'm also using configs for both standard host mongodb and serverless mongodb cluster on Atlas. When running on ATLAS i need to have some extra configuration, on datasets i use the
config/env/folders, and for sessions i made a crazy if/else loop to make the right connection string.The configurations are set on a
.envfile or usingENVIRONMENT VARIABLES.File
datastores.js:The
session.jsfile: