payload
payload copied to clipboard
DocumentDB: cursur within transaction not supported, rest API 500 error above 101 results
Link to reproduction
No response
Describe the Bug
When calling a rest endpoint with a limit higher then 101 and more then 101 results, DocumentDB throws the following error:
MongoServerError: Feature not supported: cursor within transaction. Try increasing the batchsize
This seems to be causes by a limitation of Documentdb
To Reproduce
- Add more then 101 items to a collection
- Open de admin interface and copy a collection view rest api call
- Up the limit to 102 and the api call will return an 500 error
{"errors":[{"message":"Something went wrong."}]}
Payload Version
2.3.1
Adapters and Plugins
@payloadcms/db-mongodb
Sorry for the delay. You might consider using the new db: mongooseAdapter( { transactionOptions: false } ) option which disables the use of transactions until this is sorted out.
We are having the same problem. Any possible solution that doesn't require disabling transactions?
@DanRibbens or, is there a way to disable transactions only in a specific (local or REST) API call? Our current workaround would be to use a custom endpoint which fetches all documents using the db adapter in order to not use a transaction, but this way we still need to deal with authorization.