MongoDB 6 introduced the capability to query encrypted data in the database. Data is encrypted for the entire round trip: at insert, storage, and query. This amounts to a new level of security for data, which remains secure even as it is used within the database. Only the client application is capable of decrypting the data. The database does not hold the keys to the encrypted data at all, yet it still supports querying that data.
Thus MongoDB queryable encryption removes the data store and its infrastructure as targets of attack. This quasi-magical capability does require some extra configuration for applications. This article will show you how to set up a development environment for working with MongoDB queryable encryption in a Node.js application.