MongoServerError: The 'expireAfterSeconds' option is supported on '_ts' field only. at Connection.onMessage
SamBruner-USDA opened this issue · comments
SamBruner-USDA commented
we are using a mondo db compatible database in cosmosdb. We get this error when we try to start sasjs server
MongoServerError: The 'expireAfterSeconds' option is supported on '_ts' field only.
at Connection.onMessage
Allan Bowe commented
Investigating these resources:
- https://stackoverflow.com/questions/59638751/the-expireafterseconds-option-is-supported-on-ts-field-only-error-is-s
- https://www.npmjs.com/package/connect-mongo#set-the-compatibility-mode
It appears we need to enable compatibility mode for COSMOS-hosted Mongo DB instances.
We propose to support this through the addition of an additional server setting - DB_TYPE
. This will be MONGODB
by default, with an alternative setting of COSMOS_MONGODB
.
DB_TYPE=COSMOS_MONGODB
will result in compatibility mode being enabled.