I’m currently working on setting up client-side field level encryption (CSFLE) using Node.js, Express, and Mongoose, following the tutorial for Use Automatic Client-Side Field Level Encryption with AWS I’ve ensured that all the steps recommended in the tutorial have been followed, and I’m running a MongoDB Enterprise server.
However, when I try to insert a document using the secure client, I encounter the following error:
Error: MongoServerError: BSON field 'FindCommandRequest.jsonSchema' is an unknown field. This command may be meant for a mongocryptd process.
Has anyone encountered this issue before, or does anyone have insights on how to resolve this error?
Any help or guidance would be greatly appreciated!
Hmmm… Any chance you can post a link to your code or your itself code here? I can’t promise to solve it, but I’m curious to take a look and see if I can spot or reproduce the problem.
By the way i changed my source code after that and i would love to share that because i saw a few people have problems to figure out how they can structure regularClients and secureClients with their needed models to those connections. Is their a possibility to make a request to add this to the documenation links for code examples?
The code was the same as you can find it in the gothub example. But i got it resolved. Somehow I didn’t saw that the mongocryptd process got blocked as process by the system so it was not running. I got it working after i sae that. So the solution for that is that the mongocrypt process has to be started.
Very good. You can also use the shared library, crypt-shared, which simply loads at runtime (you may need to make sure your OS allows it to load if your OS blocks binaries).