MongoDB is not a dedicated key-value store, but it's probably the most popular NoSQL database, so in many projects there's already a running instance, so instead of forcing developers in those projects to set up and administrate another database, it makes sense to utilize what's already there.
Instead of storing the value for the key, a wrapping type probably needs to be created which contains the key as _id and the value as value attribute. The type could be called KVpair, goKVpair or something similar.
There's no official Go SDK for MongoDB, but the official documentation recommends a fork of an open source project:
MongoDB is not a dedicated key-value store, but it's probably the most popular NoSQL database, so in many projects there's already a running instance, so instead of forcing developers in those projects to set up and administrate another database, it makes sense to utilize what's already there.
Instead of storing the value for the key, a wrapping type probably needs to be created which contains the key as
_idand the value asvalueattribute. The type could be calledKVpair,goKVpairor something similar.There's no official Go SDK for MongoDB, but the official documentation recommends a fork of an open source project: