I am trying to find the solution to a problem I am having attempting to use some of the encryption related methods. Originally I was following the entire CSFLE / AWS tutorial, but eventually found this method for the ClientEncryption sub-type
Encrypt(ctx context.Context, val bson.RawValue, opts
...*options.EncryptOptions) (primitive.Binary, error)`
When attempting to use it, I get the error in the title of this topic: mongocrypt error 1: invalid msg, must contain 'v'"
What does this error mean, and how can I assess it? I’ve followed most of the CSFLE/AWS tutorial for GoLang meaning I’ve set up a KeyVault, a DEK, and created an encryption client.
This error indicates that the argument passed to the val parameter of the Encrypt method uses an invalid bson encoding, or no encoding at all: bson.RawValue{}. For instance, the following would cause this error since it uses a json encoding for the string type: