@@ -85,6 +85,23 @@ To learn more about the shapes you can use in MongoDB, see the
8585
8686.. external resource
8787
88+ Insert a Document Containing GeoJSON Data
89+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
90+
91+ To insert a document that stores GeoJSON data, create a document that contains a GeoJSON
92+ value and pass the document to the ``insertOne()`` method.
93+
94+ The following example inserts a document that includes a ``location.geo`` field,
95+ which contains GeoJSON data:
96+
97+ .. literalinclude:: /includes/fundamentals/code-snippets/Geo.java
98+ :language: java
99+ :dedent:
100+ :start-after: begin insertGeoJSONExample
101+ :end-before: end insertGeoJSONExample
102+
103+ To learn more about inserting documents, see the :ref:`java-fundamentals-insert` guide.
104+
88105Index
89106~~~~~
90107
@@ -118,6 +135,24 @@ Legacy coordinate pairs have the following structure:
118135Your field should contain an array of two values in which the first represents
119136the ``x`` axis value and the second represents the ``y`` axis value.
120137
138+ Insert a Document Containing Legacy Coordinates
139+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
140+
141+ To insert a document that stores a legacy coordinate pair, create a document that
142+ assigns a coordinate pair value to a field. Then, pass the document to the
143+ ``insertOne()`` method.
144+
145+ The following example inserts a document that includes a ``coordinates`` field,
146+ which contains a legacy coordinate pair:
147+
148+ .. literalinclude:: /includes/fundamentals/code-snippets/Geo.java
149+ :language: java
150+ :dedent:
151+ :start-after: begin insertLegacyExample
152+ :end-before: end insertLegacyExample
153+
154+ To learn more about inserting documents, see the :ref:`java-fundamentals-insert` guide.
155+
121156Index
122157~~~~~
123158
0 commit comments