Skip to content

DOCSP-49786 - Projection methods #644

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
1 change: 1 addition & 0 deletions source/aggregation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Aggregation Operations
:maxdepth: 1

Pipeline Stages </aggregation/stages>
LINQ </aggregation/linq>

Overview
--------
Expand Down
4 changes: 2 additions & 2 deletions source/aggregation/linq.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The {+driver-short+} automatically translates LINQ queries into
The examples in this guide use the ``restaurants`` collection
in the ``sample_restaurants`` database provided in the :atlas:`Atlas sample datasets </sample-data>`.
To learn how to create a free MongoDB Atlas cluster and load the sample datasets,
see the :ref:`<csharp-quickstart>`.
see :ref:`<csharp-get-started>`.

The following ``Restaurant``, ``Address`` and ``GradeEntry`` classes model the
documents in this collection:
Expand Down Expand Up @@ -1025,7 +1025,7 @@ aggregation stages:
- ``$out``

To learn how to create an aggregation pipeline with the ``$out`` stage by using Builders, see
the :ref:`<csharp-builders-out>` section.
:ref:`<csharp-aggregation-stages>`.

Supported Methods
-----------------
Expand Down
1 change: 0 additions & 1 deletion source/aggregation/stages.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.. _csharp-aggregation-stages:
.. _csharp-builders-aggregation:
.. _csharp-linq:

===========================
Aggregation Pipeline Stages
Expand Down
81 changes: 25 additions & 56 deletions source/atlas-search.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The examples in this guide use the following documents in a collection called
``guitars``:

.. code-block:: json

{ "_id": 1, "make": "Fender", "description": "Classic guitars known for their versatility.", "establishedYear": 1946, "in_stock": true, "rating": 9 }
{ "_id": 2, "make": "Gibson", "description": "Classic guitars known for their rich, full tones.", "establishedYear": 1902, "in_stock": true, "rating": 8 }
{ "_id": 3, "make": "PRS", "description": "High-end guitars known for their quality.", "establishedYear": 1985, "in_stock": true, "rating": 9 }
Expand Down Expand Up @@ -75,7 +75,7 @@ Create an Atlas Search Index

Before you can perform a search on an Atlas collection, you must first create an **Atlas
Search index** on the collection. An Atlas Search index is a data structure that
categorizes data in a searchable format.
categorizes data in a searchable format.

To learn how to create an Atlas Search Index see the
:atlas:`Create an Atlas Search Index </atlas-search/create-index>` Atlas guide.
Expand Down Expand Up @@ -103,7 +103,7 @@ collection using the string "Gib" in the ``make`` field.
:dedent:

.. note::

If the field you are searching on is indexed by a search index, you must pass the index name to the ``Autocomplete`` call. If a search index does not exist, the default index is used.

The search returns the following document:
Expand All @@ -112,7 +112,7 @@ The search returns the following document:

{ "_id" : 2, "make" : "Gibson", "description" : "Classic guitars known for their rich, full tones.", "establishedYear" : 1902, "in_stock" : true, "rating" : 8 }

To learn more about the ``autocomplete`` operator, see the :atlas:`autocomplete </atlas-search/autocomplete>`
To learn more about the ``autocomplete`` operator, see the :atlas:`autocomplete </atlas-search/autocomplete>`
Atlas guide.

Compound
Expand Down Expand Up @@ -142,7 +142,7 @@ The search returns the following documents:
{ "_id" : 3, "make" : "PRS", "description" : "...", "establishedYear" : 1985, "in_stock" : true, "rating" : 9 }
{ "_id" : 5, "make" : "Ibanez", "description" : "...", "establishedYear" : 1957, "in_stock" : true, "rating" : 7 }

To learn more about the ``compound`` operator, see the :atlas:`compound </atlas-search/compound>`
To learn more about the ``compound`` operator, see the :atlas:`compound </atlas-search/compound>`
Atlas guide.

EmbeddedDocument
Expand All @@ -153,7 +153,7 @@ within a field's array value.

.. note::

To search on embedded documents, you must create an
To search on embedded documents, you must create an
``embeddedDocument`` index on the array field.

To learn how to define an ``embeddedDocument`` index, see
Expand Down Expand Up @@ -218,7 +218,7 @@ The search returns the following documents:
{ "_id" : 5, "make" : "Ibanez", "description" : "...", "establishedYear" : 1957, "in_stock" : true, "rating" : 7 }


To learn more about the ``equals`` operator, see the :atlas:`equals </atlas-search/equals>`
To learn more about the ``equals`` operator, see the :atlas:`equals </atlas-search/equals>`
Atlas guide.

Exists
Expand Down Expand Up @@ -246,8 +246,7 @@ The search returns the following documents:
{ "_id" : 3, "make" : "PRS", "description" : "...", "establishedYear" : 1985, "in_stock" : true, "rating" : 9 }
{ "_id" : 5, "make" : "Ibanez", "description" : "...", "establishedYear" : 1957, "in_stock" : true, "rating" : 7 }


To learn more about the ``exists`` operator, see the :atlas:`exists </atlas-search/exists>`
To learn more about the ``exists`` operator, see the :atlas:`exists </atlas-search/exists>`
Atlas guide.

GeoShape
Expand All @@ -266,7 +265,7 @@ Consider some documents in the ``guitars`` collection have added an
follows:

.. code-block:: json

{ "_id": 1, "make": "Fender", "description": "...", "establishedYear": 1946, "in_stock": true, "in_stock_location": { "type": "Point", "coordinates": [ -73.93615, 40.69791 ]}, "rating": 9 }
{ "_id": 2, "make": "Gibson", "description": "...", "establishedYear": 1902, "in_stock": true, "in_stock_location": { "type": "Point", "coordinates": [ 47.6062, 122.321 ]}, "rating": 8 }

Expand All @@ -286,7 +285,7 @@ The search returns the following document:

{ "_id" : 1, "make" : "Fender", "description" : "...", "establishedYear" : 1946, "in_stock" : true, "in_stock_location" : { "type" : "Point", "coordinates" : ["-73.93615", "40.69791"] }, "rating" : 9 }

To learn more about the ``geoShape`` operator, see the :atlas:`geoShape </atlas-search/geoShape>`
To learn more about the ``geoShape`` operator, see the :atlas:`geoShape </atlas-search/geoShape>`
Atlas guide.

GeoWithin
Expand All @@ -312,13 +311,13 @@ Consider some documents in the ``guitars`` collection have added an
follows:

.. code-block:: json

{ "_id": 1, "make": "Fender", "description": "...", "establishedYear": 1946, "in_stock": true, "in_stock_location": { "type": "Point", "coordinates": [ -73.93615, 40.69791 ]}, "rating": 9 }
{ "_id": 2, "make": "Gibson", "description": "...", "establishedYear": 1902, "in_stock": true, "in_stock_location": { "type": "Point", "coordinates": [ 47.6062, 122.321 ]}, "rating": 8 }

The following example searches for all documents in which the
coordinates in the ``in_stock_location`` field falls within a specified
polygon:
polygon:

.. literalinclude:: /includes/fundamentals/code-examples/atlas-search/AtlasSearchExamples.cs
:start-after: // start-geowithin-search
Expand All @@ -332,7 +331,7 @@ The search returns the following document:

{ "_id" : 1, "make" : "Fender", "description" : "Classic guitars known for their versatility.", "establishedYear" : 1946, "in_stock" : true, "in_stock_location" : { "type" : "Point", "coordinates" : ["-73.93615", "40.69791"] }, "rating" : 9 }

To learn more about the ``geoWithin`` operator, see the :atlas:`geoWithin </atlas-search/geoWithin>`
To learn more about the ``geoWithin`` operator, see the :atlas:`geoWithin </atlas-search/geoWithin>`
Atlas guide.

In
Expand Down Expand Up @@ -381,7 +380,7 @@ The search returns the following documents:
{ "_id" : 4, "make" : "Kiesel", "description" : "Quality guitars made only for custom orders.", "establishedYear" : 2015, "in_stock" : false, "rating" : null }


To learn more about the ``moreLikeThis`` operator, see the :atlas:`moreLikeThis </atlas-search/morelikethis>`
To learn more about the ``moreLikeThis`` operator, see the :atlas:`moreLikeThis </atlas-search/morelikethis>`
Atlas guide.

Near
Expand Down Expand Up @@ -414,7 +413,7 @@ The search returns the following documents:
{ "_id" : 5, "make" : "Ibanez", "description" : "...", "establishedYear" : 1957, "in_stock" : true, "rating" : 7 }


To learn more about the ``near`` operator, see the :atlas:`near </atlas-search/near>`
To learn more about the ``near`` operator, see the :atlas:`near </atlas-search/near>`
Atlas guide.

Phrase
Expand Down Expand Up @@ -456,7 +455,7 @@ This search returns the following documents:
{ "_id" : 4, "make" : "Kiesel", "description" : "Quality guitars made only for custom orders.", "establishedYear" : 2015, "in_stock" : false, "rating" : null }
{ "_id" : 2, "make" : "Gibson", "description" : "Classic guitars known for their rich, full tones.", "establishedYear" : 1902, "in_stock" : true, "rating" : 8 }

To learn more about the ``phrase`` operator, see the :atlas:`phrase </atlas-search/phrase>`
To learn more about the ``phrase`` operator, see the :atlas:`phrase </atlas-search/phrase>`
Atlas guide.

QueryString
Expand All @@ -466,7 +465,7 @@ Use the ``QueryString()`` method to search for documents using a string with
the following operators and delimiters:

- ``AND``
- ``OR``
- ``OR``
- ``NOT``
- ``()``

Expand All @@ -490,7 +489,7 @@ The search returns the following documents:
{ "_id" : 3, "make" : "PRS", "description" : "High-end guitars known for their quality.", "establishedYear" : 1985, "in_stock" : true, "rating" : 9 }
{ "_id" : 2, "make" : "Gibson", "description" : "Classic guitars known for their rich, full tones.", "establishedYear" : 1902, "in_stock" : true, "rating" : 8 }

To learn more about the ``queryString`` operator, see the :atlas:`queryString </atlas-search/queryString>`
To learn more about the ``queryString`` operator, see the :atlas:`queryString </atlas-search/queryString>`
Atlas guide.

Range
Expand All @@ -516,7 +515,7 @@ The search returns the following results:
{ "_id" : 4, "make" : "Kiesel", "description" : "Quality guitars made only for custom orders.", "establishedYear" : 2015, "in_stock" : false, "rating" : null }
{ "_id" : 6, "make" : "Strandberg", "description" : "Modern guitars known for their headless models.", "establishedYear" : 1982, "in_stock" : false, "rating" : null }

To learn more about the ``range`` operator, see the :atlas:`range </atlas-search/range>`
To learn more about the ``range`` operator, see the :atlas:`range </atlas-search/range>`
Atlas guide.

Regex
Expand Down Expand Up @@ -558,7 +557,7 @@ The search returns the following results:
search results. To learn more, see :atlas:`regex Behavior
</atlas-search/regex/#behavior>`.

To learn more about the ``regex`` operator, see the :atlas:`regex </atlas-search/regex>`
To learn more about the ``regex`` operator, see the :atlas:`regex </atlas-search/regex>`
Atlas guide.

Span
Expand Down Expand Up @@ -593,7 +592,7 @@ Although the document with ``_id: 3`` contains the strings "guitars" and
"quality", they are separated by more than one word, so the search omits this
document from the results.

To learn more about the ``span`` operator, see the :atlas:`span </atlas-search/span>`
To learn more about the ``span`` operator, see the :atlas:`span </atlas-search/span>`
Atlas guide.

Text
Expand Down Expand Up @@ -624,7 +623,7 @@ The search returns the following document:
If your search string contains multiple terms, the method also looks for a match
for each term in the string separately.

To learn more about the ``text`` operator, see the :atlas:`text </atlas-search/text>`
To learn more about the ``text`` operator, see the :atlas:`text </atlas-search/text>`
Atlas guide.

Wildcard
Expand All @@ -640,7 +639,7 @@ characters in your search:

* - Character
- Description

* - ``?``
- Matches any single character

Expand Down Expand Up @@ -681,35 +680,5 @@ The search returns the following document:
search results. To learn more, see :atlas:`wildcard Behavior
</atlas-search/wildcard/#behavior>`.

To learn more about the ``wildcard`` operator, see the :atlas:`wildcard </atlas-search/wildcard>`
Atlas guide.

.. TODO: integrate into existing page

Sample Class
------------

The code examples in this guide demonstrate how you can use builders to
create types to interact with documents in the sample collection ``plants.flowers``.
Documents in this collection are modeled by the following ``Flower`` class:

.. literalinclude:: /includes/fundamentals/code-examples/builders.cs
:language: csharp
:dedent:
:start-after: start-model
:end-before: end-model

Each builder class takes a generic type parameter
``TDocument`` which represents the type of document that you are working
with. In this guide, the ``Flower`` class is the document type used in
each builder class example.

Build an Atlas Search Query
---------------------------

The ``Search`` class provides a type-safe interface for creating a
:manual:`$search </reference/operator/aggregation/search/>`
pipeline stage.

To learn how to construct search queries with the ``Search`` class, see
:ref:`csharp-atlas-search`.
To learn more about the ``wildcard`` operator, see the :atlas:`wildcard </atlas-search/wildcard>`
Atlas guide.
87 changes: 57 additions & 30 deletions source/atlas-vector-search.txt

Large diffs are not rendered by default.

Loading
Loading