Skip to content

Commit

Permalink
DOCSP-42961: Removed Nested Components (#581)
Browse files Browse the repository at this point in the history
* DOCSP-42961: Removed Nested Components

* Fixing indentation errors

* Fixing indentation errors again

* Fixing indentation errors again

* Fixing indentation errors again

* Fixing indentation errors again+

* Fixing indentation errors again+

* Fixing code block indentation

* tweaks based on internal review feedback

* tweaks based on internal review feedback - indentation issues

* tweaks based on internal review feedback - indentation issues

* tweaks based on internal review feedback - indentation issues

* tweaks based on internal review feedback - indentation issues

* tweaks to bullet issue

* tweaks to bullet issue

(cherry picked from commit 1ec4a2c)
  • Loading branch information
caitlindavey committed Oct 23, 2024
1 parent bcde2e5 commit ffe51a0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 43 deletions.
35 changes: 16 additions & 19 deletions source/fundamentals/connection/mongoclientsettings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,26 +259,23 @@ settings to modify the driver's behavior:

* - ``serverSelector()``
- Adds a server selector to apply before server selection.

* - ``srvHost()``
- Sets the host name to use to look up an SRV DNS record to find the
MongoDB hosts.

.. note::

When setting ``srvHost``, the driver does not process any
associated TXT records associated with the host.

If you want to enable the processing of TXT records, you must
specify the SRV host in the connection string using the
``applyConnectionString()`` method.

.. code-block:: java
:emphasize-lines: 3

MongoClient mongoClient = MongoClients.create(
MongoClientSettings.builder()
.applyConnectionString(new ConnectionString("mongodb+srv://host1.acme.com")))
- | Sets the host name to use to look up an SRV DNS record to find the
MongoDB hosts.
|
| If you want to enable the processing of TXT records associated with the host,
specify the SRV host in the connection string
using the ``applyConnectionString()`` method.
|
| For example:

.. code-block:: java
:emphasize-lines: 3

MongoClient mongoClient =
MongoClients.create(MongoClientSettings.builder()
.applyConnectionString(new ConnectionString("mongodb+srv://host1.acme.com")))

* - ``srvMaxHosts()``
- | Sets the maximum number of hosts the driver can connect to when using
Expand Down
40 changes: 16 additions & 24 deletions source/fundamentals/data-formats/pojo-customization.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,7 @@ package:

* - ``BsonRepresentation``
- Specifies the BSON type used to store the value when different from the
POJO property.

.. seealso::

:ref:`bsonrepresentation-annotation-code-example`
POJO property. See an example of :ref:`bsonrepresentation-annotation-code-example` on this page.

* - ``BsonId``
- Marks a property to serialize as the _id property.
Expand All @@ -299,28 +295,24 @@ package:
and/or deserialize a property.

* - ``BsonProperty``
- Specifies a custom document field name when converting the POJO
field to BSON. You can include a discriminator to serialize POJOs
nested within the field.

.. important::
- | Specifies a custom document field name when converting the POJO
field to BSON. You can include a discriminator to serialize POJOs
nested within the field.
|
| When applying ``@BsonProperty`` to a private field,
**you must also add getter and setter methods for that field to serialize and
customize the field name**.

When applying ``@BsonProperty`` to a private field, you must also add
getter and setter methods for that field to serialize and customize
the field name.

* - ``BsonExtraElements``
- Specifies the POJO field on which to deserialize all elements that are
not mapped to a field. The POJO field must be one of the following
types:

- `Document <{+api+}/apidocs/bson/org/bson/Document.html>`__
- `BsonDocument <{+api+}/apidocs/bson/org/bson/BsonDocument.html>`__
- ``Map<String, Object>``

.. seealso::

:ref:`BsonExtraElements Annotation Example <bsonextraelements-annotation-code-example>`
- | Specifies the POJO field on which to deserialize all elements that are
not mapped to a field. The POJO field must be one of the following
types:
| - `Document <{+api+}/apidocs/bson/org/bson/Document.html>`__
| - `BsonDocument <{+api+}/apidocs/bson/org/bson/BsonDocument.html>`__
| - ``Map<String, Object>``
|
| See an example of a :ref:`BsonExtraElements Annotation Example <bsonextraelements-annotation-code-example>`.

The following code snippet shows a sample POJO called ``Product`` that uses
several of the preceding annotations.
Expand Down

0 comments on commit ffe51a0

Please sign in to comment.