Skip to content

[Java Sync] P2 - Shift Java ToC #617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion config/redirects
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ symlink: upcoming -> master
raw: ${prefix}/ -> ${base}/current/
raw: ${prefix}/master -> ${base}/upcoming/

[*-master]: ${prefix}/${version}/fundamentals/versioned-api/ -> ${base}/${version}/fundamentals/stable-api/
[*-v5.2]: ${prefix}/${version}/fundamentals/versioned-api/ -> ${base}/${version}/fundamentals/stable-api/
[*-v4.6]: ${prefix}/${version}/fundamentals/crud/read-operations/change-streams/ -> ${base}/${version}/fundamentals/crud/read-operations/retrieve/
[*-master]: ${prefix}/${version}/fundamentals/csfle/ -> ${base}/${version}/fundamentals/encrypt-fields/
[*-master]: ${prefix}/${version}/fundamentals/crud/write-operations/change-a-document/ -> ${base}/${version}/fundamentals/crud/write-operations/modify/
Expand Down Expand Up @@ -50,3 +50,25 @@ raw: ${prefix}/master -> ${base}/upcoming/
[v5.3-master]: ${prefix}/${version}/fundamentals/connection/socks/ -> ${base}/${version}/connection/socks/
[v5.3-master]: ${prefix}/${version}/fundamentals/connection/tls/ -> ${base}/${version}/security/tls/
[v5.3-master]: ${prefix}/${version}/fundamentals/connection/jndi/ -> ${base}/${version}/connection/jndi/
[v5.3-master]: ${prefix}/${version}/fundamentals/builders/ -> ${base}/${version}/crud/builders/
[v5.3-master]: ${prefix}/${version}/fundamentals/builders/aggregates/ -> ${base}/${version}/crud/builders/aggregates/
[v5.3-master]: ${prefix}/${version}/fundamentals/builders/filters/ -> ${base}/${version}/crud/builders/filters/
[v5.3-master]: ${prefix}/${version}/fundamentals/builders/indexes/ -> ${base}/${version}/crud/builders/indexes/
[v5.3-master]: ${prefix}/${version}/fundamentals/builders/projections/ -> ${base}/${version}/crud/builders/projections/
[v5.3-master]: ${prefix}/${version}/fundamentals/builders/sort/ -> ${base}/${version}/crud/builders/sort/
[v5.3-master]: ${prefix}/${version}/fundamentals/builders/updates/ -> ${base}/${version}/crud/builders/updates/
[v5.3-master]: ${prefix}/${version}/fundamentals/builders/vector-search -> ${base}/${version}/atlas-vector-search/
[v5.3-master]: ${prefix}/${version}/fundamentals/aggregation/ -> ${base}/${version}/crud/aggregation/
[v5.3-master]: ${prefix}/${version}/fundamentals/aggregation-expression-operations/ -> ${base}/${version}/crud/aggregation-expression-operations/
[v5.3-master]: ${prefix}/${version}/fundamentals/collations/ -> ${base}/${version}/crud/collations/
[v5.3-master]: ${prefix}/${version}/fundamentals/stable-api/ -> ${base}/${version}/connection/stable-api/
[v5.3-master]: ${prefix}/${version}/connection-troubleshooting/ -> ${base}/${version}/connection/connection-troubleshooting/
[v5.3-master]: ${prefix}/${version}/fundamentals/gridfs/ -> ${base}/${version}/crud/gridfs/
[v5.3-master]: ${prefix}/${version}/fundamentals/transactions/ -> ${base}/${version}/crud/transactions/
[v5.3-master]: ${prefix}/${version}/fundamentals/time-series/ -> ${base}/${version}/data-formats/time-series/
[v5.3-master]: ${prefix}/${version}/quick-start/ -> ${base}/${version}/getting-started/
[v5.3-master]: ${prefix}/${version}/fundamentals/databases-collections/ -> ${base}/${version}/getting-started/databases-collections/
[v5.3-master]: ${prefix}/${version}/integrations/ -> ${base}/${version}/getting-started/integrations/
[v5.3-master]: ${prefix}/${version}/quick-reference/ -> ${base}/${version}/getting-started/quick-reference/
[v5.3-master]: ${prefix}/${version}/fundamentals/enterprise-auth/ -> ${base}/${version}/security/enterprise-auth/
[v5.3-master]: ${prefix}/${version}/connection/socks/ -> ${base}/${version}/security/socks/
91 changes: 88 additions & 3 deletions source/atlas-vector-search.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Atlas Vector Search
:values: reference

.. meta::
:keywords: full text, text analyzer, meta, pipeline, scoring, Lucene, AI, artificial intelligence
:keywords: full text, text analyzer, meta, pipeline, scoring, Lucene, AI, artificial intelligence, code example, semantic, nearest
:description: Learn about how to use Atlas Vector Search in the {+driver-long+}.

.. contents:: On this page
Expand All @@ -18,5 +18,90 @@ Atlas Vector Search
:depth: 2
:class: singlecol

See :atlas:`Atlas Vector Search </atlas-vector-search/vector-search-overview/>`
in the MongoDB Atlas documentation.
Overview
--------

In this guide, you can learn how to use the :atlas:`Atlas Vector Search
</atlas-vector-search/vector-search-overview/>` feature
in the {+driver-short+}. The ``Aggregates`` builders class provides the
the ``vectorSearch()`` helper method that you can use to
create a :atlas:`$vectorSearch </atlas-vector-search/vector-search-stage/>`
pipeline stage. This pipeline stage allows you to perform a **semantic
search** on your documents. A semantic search is a type of search which
locates information that is similar in meaning, but not necessarily
identical, to your provided search term or phrase.

.. important:: Feature Compatibility

To learn what versions of MongoDB Atlas support this feature, see
:atlas:`Limitations </atlas-vector-search/vector-search-stage/#limitations>`
in the MongoDB Atlas documentation.

Perform a Vector Search
-----------------------

To use this feature, you must create a vector search index and index your
vector embeddings. To learn about how to programmatically create a
vector search index, see the :ref:`java-search-indexes` section in the
Indexes guide. To learn more about vector embeddings, see
:atlas:`How to Index Vector Embeddings for Vector Search
</atlas-search/field-types/knn-vector/>` in the Atlas documentation.

After you create a vector search index on your vector embeddings, you
can reference this index in your pipeline stage, as shown in the
following section.

Vector Search Example
~~~~~~~~~~~~~~~~~~~~~

The following example shows how to build an aggregation pipeline that uses the
``vectorSearch()`` and ``project()`` methods to compute a vector search score:

.. literalinclude:: /includes/fundamentals/code-snippets/builders/AggBuilders.java
:start-after: // begin vectorSearch
:end-before: // end vectorSearch
:language: java
:dedent:

.. tip:: Query Vector Type

The preceding example creates an instance of ``BinaryVector`` to
serve as the query vector, but you can also create a ``List`` of
``Double`` instances. However, we recommend that you use the
``BinaryVector`` type to improve storage efficiency.

The following example shows how you can run the aggregation and print
the vector search meta-score from the result of the preceding
aggregation pipeline:

.. literalinclude:: /includes/fundamentals/code-snippets/builders/AggBuilders.java
:start-after: // begin vectorSearch-output
:end-before: // end vectorSearch-output
:language: java
:dedent:

.. tip:: Java Driver Vector Search Examples

Visit the :atlas:`Atlas documentation </atlas-vector-search/tutorials/>`
to find more tutorials on using the {+driver-short+} to perform Atlas
Vector Searches.

API Documentation
-----------------

To learn more about the methods and types mentioned in this
guide, see the following API documentation:

- `Aggregates.vectorSearch()
<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#vectorSearch(com.mongodb.client.model.search.FieldSearchPath,java.lang.Iterable,java.lang.String,long,com.mongodb.client.model.search.VectorSearchOptions)>`__

- `FieldSearchPath
<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/search/FieldSearchPath.html>`__

- `VectorSearchOptions
<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/search/VectorSearchOptions.html>`__

- `Projections.metaVectorSearchScore()
<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Projections.html#metaVectorSearchScore(java.lang.String)>`__

- `BinaryVector <{+api+}/apidocs/bson/org/bson/BinaryVector.html>`__
3 changes: 2 additions & 1 deletion source/connection.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ Connection Guide
Connect to MongoDB </connection/connect>
Connection Options </connection/connection-options>
MongoClient Settings </connection/mongoclientsettings>
Stable API </connection/stable-api>
Network Compression </connection/network-compression>
SOCKS5 Proxy </connection/socks>
JNDI Datasource </connection/jndi>
Connection Troubleshooting </connection/connection-troubleshooting>
AWS Lambda <https://www.mongodb.com/docs/atlas/manage-connections-aws-lambda/>

.. contents:: On this page
Expand Down
4 changes: 1 addition & 3 deletions source/connection/connect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ Use the ``MongoClients.create()`` method to construct a ``MongoClient``.

As each ``MongoClient`` represents a thread-safe pool of connections to the
database, most applications only require a single instance of a
``MongoClient``, even across multiple threads. To learn more about
how connection pools work in the driver, see the :ref:`FAQ page <java-faq-connection-pool>`.

``MongoClient``, even across multiple threads.
All resource usage limits, such as max connections, apply to individual
``MongoClient`` instances.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ Connection Troubleshooting
finding more resources
- The `MongoDB Community Forums <{+communityForums+}>`__ for
questions, discussions, or general technical support
- The :ref:`Frequently Asked Questions (FAQ) <java-faq>` page for
answers to common questions about the {+driver-short+}

.. replacement:: server-selection-timeout-error

Expand Down Expand Up @@ -150,11 +148,6 @@ Connection Troubleshooting

``maxIdleTimeMS``

.. replacement:: connection-pools-learn-more

To learn more about how connection pooling works in the driver, see
:ref:`java-faq-connection-pool` in the FAQ.

.. replacement:: scram-failure-error

.. code-block::
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions source/crud.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ CRUD Operations
Write </crud/write-operations>
Query </crud/query-document>
Compound Operations </crud/compound-operations>
Transactions </crud/transactions>
Builders </crud/builders>
Aggregation </crud/aggregation>
Aggregation Expressions </crud/aggregation-expression-operations>
Collations </crud/collations>
Large File Storage with GridFS </crud/gridfs>

CRUD (Create, Read, Update, Delete) operations enable you to work with
data stored in MongoDB.
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions source/fundamentals/builders.txt → source/crud/builders.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Builders

.. toctree::

Aggregation </builders/aggregates>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page also needs to be added to list of toc_landing_pages

Filters </builders/filters>
Indexes </builders/indexes>
Projection </builders/projections>
Sort </builders/sort>
Update </builders/updates>
Aggregation </crud/builders/aggregates>
Filters </crud/builders/filters>
Indexes </crud/builders/indexes>
Projection </crud/builders/projections>
Sort </crud/builders/sort>
Update </crud/builders/updates>

.. contents:: On this page
:local:
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 9 additions & 3 deletions source/fundamentals/gridfs.txt → source/crud/gridfs.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
======
GridFS
======
==============================
Large File Storage with GridFS
==============================

.. facet::
:name: genre
:values: reference

.. meta::
:keywords: retrieve, size limit
:description: Store large files with GridFS in the {+driver-long+}.

.. contents:: On this page
:local:
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion source/data-formats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ Data Formats
Extended JSON </data-formats/document-data-format-extended-json>
Documents </data-formats/documents>
POJOs </data-formats/document-data-format-pojo>
Records </data-formats/document-data-format-record>
POJO Customization </data-formats/pojo-customization>
Records </data-formats/document-data-format-record>
Codecs </data-formats/codecs>
Time Series Collections </data-formats/time-series>

- :doc:`/data-formats/document-data-format-bson`
- :doc:`/data-formats/document-data-format-extended-json`
Expand Down
106 changes: 0 additions & 106 deletions source/fundamentals/builders/vector-search.txt

This file was deleted.

14 changes: 11 additions & 3 deletions source/quick-start.txt → source/getting-started.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _java-sync-quickstart:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to add this page to this list of toc_landing_pages in the snooty.toml, otherwise you can't click into this page from the ToC sidebar.


=======================
Java Driver Quick Start
=======================
===============
Getting Started
===============

.. facet::
:name: genre
Expand All @@ -17,6 +17,14 @@ Java Driver Quick Start
:depth: 2
:class: singlecol

.. toctree::
:titlesonly:
:maxdepth: 1

Quick Reference </getting-started/quick-reference>
Databases and Collections </getting-started/databases-collections>
Integrations </getting-started/integrations>

Introduction
------------

Expand Down
File renamed without changes.
File renamed without changes.
Loading
Loading