-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sequence not counting on cosmosDB #117
Comments
To be honest, I don't know. I never tried it on CosmosDB. There's nothing special in this middleware, so as long as basic operations on mongo are supported on cosmos, it should work. I can't tell you more, sorry |
hello ramiel, thank you for your quick response. While debugging it seems that every time the lastErrorObject.updatedExisting is false at the counter and it puts in the startSeq everytime
we are using "mongoose": "5.13.14", do you have any additional ideas? |
I also have this issue. My app was using MongoDB in MongoCloud and everything was working as expected. But a switch to Azure CosmosDB was neccessary and suddenly mongoose-sequence stopped working. Through local debugging and testing I found the cause(s) and how to fix them. Cosmos/Mongo will prevent inserting and updating of Counters documents when the uniqueness check in the defined index is in place. So changing (line 200)
to
is the first step. Since you already use upserts with filtering for As @sghoe mentions in the above comment in the callback in
to
With these two changes I could get my app to work with CosmosDB. Counter-documents where created again as expected and |
Hello, thank you for this nice middleware.
We switched from mongoDB to cosmosDB but it stopped counting. The counters were created, but the seq. stays and remains at 1.
Now we are on:
Is sequence compatible with cosmosDB?
The text was updated successfully, but these errors were encountered: