Storage write rejected - how to design RPCs with regards to storage object write/read + version

We are moving from godot + mariaDb server to nakama. In the current implementation we have a “database compilation” process which generates SQL insert statements which are then forwarded to the database. Its meant as a “migration” step when new items are added, so it will happen very rarely.

I want to adapt this “compilation” process for nakama. First I’ve created a REST API for adding a single item data to the storage, and removing all item data from storage.

When calling the RPCs I get this error:
“Storage write rejected - version check failed.”

For this use case I would like to be able to disable the version check, but I understand that it might not be possible.

Therefore I wonder how my RPC module code should look like, currently it works like this (im using TypeScript):

func rpc():
  data, version = getMyObject
  (...) // updates data
  storeMyObject(data, version)

Another issue is that I can generate quite a lot of HTTP requests towards the API during the compilation process and I think nakama is trying to handle them concurrently which causes problems (version check issue again), can I prevent this?

You can remove the version field when trying to write to Storage and the version won’t be checked and instead a straight write will happen.

If your issue persists, please add concrete code examples that actually invoke Nakama’s API rather than storeMyObject(...).