Skip to content

Commit a8c2402

Browse files
feat(NODE-7109): support text searches for QE encrypted text fields (#83)
1 parent ed6c50c commit a8c2402

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

addon/mongocrypt.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,16 @@ Value MongoCrypt::MakeExplicitEncryptionContextInternal(
724724
}
725725
}
726726

727+
if (options.Has("textOptions")) {
728+
Uint8Array textOptionsArray = Uint8ArrayFromValue(options["textOptions"], "textOptions");
729+
730+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> binary(
731+
Uint8ArrayToBinary(textOptionsArray));
732+
if (!mongocrypt_ctx_setopt_algorithm_text(context.get(), binary.get())) {
733+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
734+
}
735+
}
736+
727737
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> binaryValue(
728738
Uint8ArrayToBinary(valueBuffer));
729739

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"license": "Apache-2.0",
3737
"gypfile": true,
38-
"mongodb:libmongocrypt": "1.14.0",
38+
"mongodb:libmongocrypt": "1.15.1",
3939
"dependencies": {
4040
"node-addon-api": "^4.3.0",
4141
"prebuild-install": "^7.1.3"
@@ -96,4 +96,4 @@
9696
"moduleResolution": "node"
9797
}
9898
}
99-
}
99+
}

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export interface MongoCrypt {
8787
keyAltName?: Uint8Array;
8888
algorithm?: string;
8989
rangeOptions?: Uint8Array;
90+
textOptions?: Uint8Array;
9091
contentionFactor?: bigint | number;
9192
queryType?: string;
9293

0 commit comments

Comments
 (0)