Add support for Azure Cosmos
mrsimonemms opened this issue · 2 comments
Azure Cosmos only supports an expiresAfterSeconds index on a column called _ts. If I were to raise a PR to fix this, would this be welcomed?
This will need an optional variable name for the expires column (and index) and to enable the expiresAfterSeconds to be set - Cosmos doesn't seem to like the 0 value
The problem is (sort of) explained here, although that's using the Connect-MongoDB library so the fix doesn't work
Depending on the complexity of the PR. As long as it doesn't break compatibility with MongoDB, we'd be happy to merge your PR.
@vkarpov15 great. It shouldn't be too complex a PR.
My thinking is to add two values to options - something like expiresColumn (defaulting to expires) and expiresAfterSeconds (defaulting to 0). Those defaults will then keep the existing stuff working as-is and then those fools using Cosmos (hello 👋) can configure their way out of the problem.
I need to keep MongoDB compatibility as we use that in our local dev version anyway - this issue suggests that the Azure architect's comment of "just use it as you would normal Mongo" might not be completely accurate 😄