Skip to content

Commit 00e821c

Browse files
DOCSP-20107 pojo redirects (#228)
* added redirect to read and write
1 parent 5fde2d3 commit 00e821c

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

source/fundamentals/crud.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _java-crud-operations:
2+
13
===============
24
CRUD Operations
35
===============

source/fundamentals/data-formats/document-data-format-pojo.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,18 @@ MongoDB Java driver using plain old Java objects (`POJOs <https://en.wikipedia.o
1818
POJOs are often used for data encapsulation, separating business logic from
1919
data representation.
2020

21-
In the following sections we show:
21+
The example in this guide shows how to perform the following:
2222

23-
- A POJO example
24-
- How to configure the driver to serialize and deserialize POJOs
25-
- Sample code to read and write documents to MongoDB using POJOs
23+
- Configure the driver to serialize and deserialize POJOs
24+
- How to read and write to documents using POJOs
2625

2726
.. _fundamentals-example-pojo:
2827

2928
Example POJO
3029
------------
3130

32-
To follow the steps in this guide, you can create your own class or use the
33-
following sample POJO class which describes some characteristics of a flower:
31+
To follow the steps in this guide, use the following sample POJO class
32+
which describes characteristics of a flower:
3433

3534
.. code-block:: java
3635

@@ -137,13 +136,12 @@ requirements:
137136

138137
CodecProvider pojoCodecProvider = PojoCodecProvider.builder().automatic(true).build();
139138

140-
.. note::
141-
142-
Codec providers also contain other objects such as ``ClassModel`` and
143-
``Convention`` instances that further define serialization behavior.
144-
For more information on codec providers and customization, see our guide
145-
on :doc:`POJO Customization </fundamentals/data-formats/pojo-customization>`.
139+
.. note::
146140

141+
Codec providers also contain other objects such as ``ClassModel`` and
142+
``Convention`` instances that further define serialization behavior.
143+
For more information on codec providers and customization, see our guide
144+
on :doc:`POJO Customization </fundamentals/data-formats/pojo-customization>`.
147145

148146
#. Add the ``PojoCodecProvider`` instance to a ``CodecRegistry``. The
149147
``CodecRegistry`` allows you to specify one or more codec providers to
@@ -189,12 +187,14 @@ requirements:
189187

190188
MongoCollection<Flower> collection = database.getCollection("flowers", Flower.class);
191189

192-
Once you have configured the preceding ``MongoCollection`` instance, you can:
190+
Once you have configured the preceding ``MongoCollection`` instance, you
191+
can perform the following :ref:`CRUD operations <java-crud-operations>`
192+
with the POJOs:
193193

194-
- save an instance of the POJO to the collection
195-
- retrieve instances of the POJO from a query on the collection
194+
- Create a document from a POJO
195+
- Retrieve data in a POJO instance
196196

197-
The following code shows how you can insert an instance of ``Flower`` into
197+
The following code snippet shows how you can insert an instance of ``Flower`` into
198198
the collection and then retrieve it as a ``List`` of your POJO class objects:
199199

200200
.. code-block:: java

0 commit comments

Comments
 (0)