@@ -399,7 +399,7 @@ Procedure
399
399
:start-after: start-get-local-key
400
400
:end-before: end-get-local-key
401
401
:language: java
402
- :emphasize-lines: 7-11
402
+ :emphasize-lines: 9-13
403
403
:dedent:
404
404
405
405
.. tab::
@@ -953,15 +953,15 @@ Procedure
953
953
954
954
.. step:: Insert a Document with Encrypted Fields
955
955
956
- Create a sample document that describes a patient's personal information.
957
- Use the encrypted client to insert it into the ``patients`` collection,
958
- as shown in the following example:
959
-
960
956
.. tabs-drivers::
961
957
962
958
.. tab::
963
959
:tabid: shell
964
960
961
+ Create a sample document that describes a patient's personal information.
962
+ Use the encrypted client to insert it into the ``patients`` collection,
963
+ as shown in the following example:
964
+
965
965
.. literalinclude:: /includes/qe-tutorials/mongosh/queryable-encryption-tutorial.js
966
966
:start-after: start-insert-document
967
967
:end-before: end-insert-document
@@ -972,6 +972,10 @@ Procedure
972
972
.. tab::
973
973
:tabid: nodejs
974
974
975
+ Create a sample document that describes a patient's personal information.
976
+ Use the encrypted client to insert it into the ``patients`` collection,
977
+ as shown in the following example:
978
+
975
979
.. literalinclude:: /includes/qe-tutorials/node/queryable-encryption-tutorial.js
976
980
:start-after: start-insert-document
977
981
:end-before: end-insert-document
@@ -982,6 +986,10 @@ Procedure
982
986
.. tab::
983
987
:tabid: python
984
988
989
+ Create a sample document that describes a patient's personal information.
990
+ Use the encrypted client to insert it into the ``patients`` collection,
991
+ as shown in the following example:
992
+
985
993
.. literalinclude:: /includes/qe-tutorials/python/queryable_encryption_tutorial.py
986
994
:start-after: start-insert-document
987
995
:end-before: end-insert-document
@@ -992,16 +1000,47 @@ Procedure
992
1000
.. tab::
993
1001
:tabid: java-sync
994
1002
1003
+ This tutorial uses POJOs as data models
1004
+ to represent the document structure. To set up your application to
1005
+ use POJOs, add the following code:
1006
+
1007
+ .. literalinclude:: /includes/qe-tutorials/java/src/main/java/com/mongodb/tutorials/qe/QueryableEncryptionTutorial.java
1008
+ :start-after: start-setup-application-pojo
1009
+ :end-before: end-setup-application-pojo
1010
+ :language: java
1011
+ :dedent:
1012
+
1013
+ To learn more about Java POJOs, see the `Plain Old Java Object
1014
+ wikipedia article <https://en.wikipedia.org/wiki/Plain_old_Java_object>`__.
1015
+
1016
+ This tutorial uses the following POJOs:
1017
+
1018
+ - ``Patient``
1019
+ - ``PatientRecord``
1020
+ - ``PatientBilling``
1021
+
1022
+ You can view these classes in the `models package of the complete Java application
1023
+ <{+sample-app-url-qe+}/java/src/main/java/com/mongodb/tutorials/qe/models>`__.
1024
+
1025
+ Add these POJO classes to your application. Then, create an instance
1026
+ of a ``Patient`` that describes a patient's personal information. Use
1027
+ the encrypted client to insert it into the ``patients`` collection,
1028
+ as shown in the following example:
1029
+
995
1030
.. literalinclude:: /includes/qe-tutorials/java/src/main/java/com/mongodb/tutorials/qe/QueryableEncryptionTutorial.java
996
1031
:start-after: start-insert-document
997
1032
:end-before: end-insert-document
998
- :emphasize-lines: 14
1033
+ :emphasize-lines: 8
999
1034
:language: java
1000
- :dedent:
1035
+ :dedent:
1001
1036
1002
1037
.. tab::
1003
1038
:tabid: go
1004
1039
1040
+ Create a sample document that describes a patient's personal information.
1041
+ Use the encrypted client to insert it into the ``patients`` collection,
1042
+ as shown in the following example:
1043
+
1005
1044
.. literalinclude:: /includes/qe-tutorials/go/queryable_encryption_tutorial.go
1006
1045
:start-after: start-insert-document
1007
1046
:end-before: end-insert-document
@@ -1012,6 +1051,10 @@ Procedure
1012
1051
.. tab::
1013
1052
:tabid: csharp
1014
1053
1054
+ Create a sample document that describes a patient's personal information.
1055
+ Use the encrypted client to insert it into the ``patients`` collection,
1056
+ as shown in the following example:
1057
+
1015
1058
.. literalinclude:: /includes/qe-tutorials/csharp/QueryableEncryptionTutorial.cs
1016
1059
:start-after: start-insert-document
1017
1060
:end-before: end-insert-document
@@ -1021,8 +1064,8 @@ Procedure
1021
1064
1022
1065
.. step:: Query on an Encrypted Field
1023
1066
1024
- The following code sample uses a ``MongoClient`` configured for automatic {+qe+}
1025
- to query on an encrypted field and view the decrypted data:
1067
+ The following code sample executes a find query on an encrypted field and
1068
+ prints the decrypted data:
1026
1069
1027
1070
.. tabs-drivers::
1028
1071
@@ -1032,7 +1075,6 @@ Procedure
1032
1075
.. literalinclude:: /includes/qe-tutorials/mongosh/queryable-encryption-tutorial.js
1033
1076
:start-after: start-find-document
1034
1077
:end-before: end-find-document
1035
- :emphasize-lines: 1-3
1036
1078
:language: javascript
1037
1079
:dedent:
1038
1080
@@ -1042,7 +1084,6 @@ Procedure
1042
1084
.. literalinclude:: /includes/qe-tutorials/node/queryable-encryption-tutorial.js
1043
1085
:start-after: start-find-document
1044
1086
:end-before: end-find-document
1045
- :emphasize-lines: 1-3
1046
1087
:language: javascript
1047
1088
:dedent:
1048
1089
@@ -1052,7 +1093,6 @@ Procedure
1052
1093
.. literalinclude:: /includes/qe-tutorials/python/queryable_encryption_tutorial.py
1053
1094
:start-after: start-find-document
1054
1095
:end-before: end-find-document
1055
- :emphasize-lines: 1-3
1056
1096
:language: python
1057
1097
:dedent:
1058
1098
@@ -1062,7 +1102,6 @@ Procedure
1062
1102
.. literalinclude:: /includes/qe-tutorials/java/src/main/java/com/mongodb/tutorials/qe/QueryableEncryptionTutorial.java
1063
1103
:start-after: start-find-document
1064
1104
:end-before: end-find-document
1065
- :emphasize-lines: 1-3
1066
1105
:language: java
1067
1106
:dedent:
1068
1107
@@ -1072,7 +1111,6 @@ Procedure
1072
1111
.. literalinclude:: /includes/qe-tutorials/go/queryable_encryption_tutorial.go
1073
1112
:start-after: start-find-document
1074
1113
:end-before: end-find-document
1075
- :emphasize-lines: 2-5
1076
1114
:language: go
1077
1115
:dedent:
1078
1116
@@ -1082,7 +1120,6 @@ Procedure
1082
1120
.. literalinclude:: /includes/qe-tutorials/csharp/QueryableEncryptionTutorial.cs
1083
1121
:start-after: start-find-document
1084
1122
:end-before: end-find-document
1085
- :emphasize-lines: 2
1086
1123
:language: csharp
1087
1124
:dedent:
1088
1125
0 commit comments