Skip to content

DOCSP-49868 - MongoUrl #629

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

Open
wants to merge 32 commits into
base: docsp-45382-comp-cvg
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion config/intersphinx.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Weirdly, giza wants a non-empty list of two or more, so we have to include extraneous/unused one --hence the python
# Weirdly, giza wants a non-empty list of two or more, so we must include extraneous/unused one --hence the python
name: python
url: https://docs.python.org/2/
path: python2.inv
Expand Down
2 changes: 1 addition & 1 deletion source/atlas-search.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Use the ``Compound()`` method to combine two or more operators into a single
search.

The following example searches the ``guitars`` collection for any documents
that match all of the following criteria:
that match all the following criteria:

- The ``rating`` field exists on the document
- The ``in_stock`` field is not ``false``
Expand Down
1,731 changes: 1,317 additions & 414 deletions source/connect/connection-options.txt

Large diffs are not rendered by default.

11 changes: 2 additions & 9 deletions source/connect/connection-options/stable-api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@
:depth: 2
:class: singlecol

.. note::

The {+stable-api+} feature requires {+mdb-server+} 5.0 or later.

You should use the {+stable-api+} feature only if all of the MongoDB
servers you're connecting to support this feature.

Overview
--------

Expand Down Expand Up @@ -46,10 +39,10 @@ version of the {+stable-api+}.
.. tip::

Once you've created a ``MongoClient``, you can't change its {+stable-api+} version.
If you need to run commands using more than one version of the
If you must run commands using more than one version of the
{+stable-api+}, instantiate a separate client with that version.

If you need to run commands not covered by the {+stable-api+}, make sure the
If you must run commands not covered by the {+stable-api+}, make sure the
"strict" option is disabled. See the section on
:ref:`{+stable-api+} Options <stable-api-options>` for more information.

Expand Down
8 changes: 4 additions & 4 deletions source/connect/connection-troubleshooting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ You can also set configuration settings by creating a ``MongoClientSettings``
object and passing that to the ``MongoClient`` constructor. You can use the
``Credential`` property to set the login credentials including specifying the
authentication database. For more information about using ``MongoClientSettings``
as well as some examples, see
and to see some examples, see
:ref:`Using MongoClientSettings <csharp-mongo-client-settings>`.

You can check if this is the issue by attempting to connect to a MongoDB
Expand Down Expand Up @@ -249,7 +249,7 @@ The following section describes a method that may help resolve the issue.
Check the Number of Connections
-------------------------------

If you need to create more open connections, increase ``MaxConnectionPoolSize``. For more
If you must create more open connections, increase ``MaxConnectionPoolSize``. For more
information about checking the number of connections, see
:ref:`Check the Number of Connections <csharp-troubleshooting-connection-number-connections>`
in the Error Sending Message section.
Expand Down Expand Up @@ -279,7 +279,7 @@ time the driver spends attempting to establish the connection by using the
:manual:`Timeout Options </reference/connection-string/#timeout-options>` in
the Server manual.

You should ensure the ``connectTimeoutMS`` setting is not lower than
Ensure the ``connectTimeoutMS`` setting is not lower than
the highest network latency you have to a member of the set. If one of the
secondary members has a latency of 10000 milliseconds, setting the
``connectTimeoutMS`` to 9000 prevents the driver from ever connecting to that
Expand All @@ -301,7 +301,7 @@ You can set this option on the connection string. The following example sets

You can also set configuration settings by creating a ``MongoClientSettings``
object and passing that to the ``MongoClient`` constructor. For more information
about using ``MongoClientSettings`` as well as some examples, see
about using ``MongoClientSettings`` and to see some examples, see
:ref:`Using MongoClientSettings <csharp-mongo-client-settings>`.

Check the Number of Connections
Expand Down
17 changes: 6 additions & 11 deletions source/connect/mongoclient.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,15 @@ connection URI to connect to a MongoDB deployment running on port ``27017`` of `
const string uri = "mongodb://localhost:27017/";
var client = new MongoClient(uri);

Configure the MongoClient
-------------------------
Configure the Connection
------------------------

You can configure settings for the ``MongoClient`` object by passing a
``MongoClientSettings`` object to the constructor. The following example creates a
``MongoClient`` object and sets the ``UseTls`` property to ``true``:
You can configure your connection in the following ways:

.. code-block:: csharp

var connectionString = "mongodb://localhost:27017/"
var settings = MongoClientSettings.FromConnectionString(connectionString);
settings.UseTls = true;
- Specifying parameters in the connection URI
- Specifying settings on a ``MongoClientSettings`` or ``MongoUrlBuilder`` object

To view a full list of the settings you can configure, see the
To learn more about configuring your connection, see the
:ref:`csharp-connection-options` guide.

API Documentation
Expand Down
2 changes: 1 addition & 1 deletion source/crud/gridfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ code.
.. note:: File Revisions

The ``Delete()`` and ``DeleteAsync()`` methods support deleting only one file at a time.
If you want to delete each file revision, or files with different upload
To delete each file revision, or files with different upload
times that share the same file name, collect the ``_id`` values of each revision.
Then, pass each ``_id`` value in separate calls to the ``Delete()`` or ``DeleteAsync()``
method.
Expand Down
10 changes: 3 additions & 7 deletions source/crud/insert.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,8 @@ Assume you want to insert the following documents:

If you attempt to insert these documents with default
``InsertManyOptions``, the driver throws a ``MongoBulkWriteException`` at the third
document because of the repeated ``_id`` value, but the documents before
the error-producing document are still inserted into your collection.

If you look inside your collection, you should be able to see the following documents:
document because of the repeated ``_id`` value. The operation adds only the first two documents
to the collection:

.. code-block:: json
:copyable: false
Expand All @@ -262,9 +260,7 @@ If you look inside your collection, you should be able to see the following docu
If you set ``IsOrdered`` to ``false`` in your insert operation, the driver will
continue to insert your documents even if some documents produce errors.
With this modified insert behavior, the driver throws an exception but inserts all documents
that do not produce errors.

If you look inside your collection, you should be able to see the following documents:
that do not produce errors:

.. code-block:: json
:copyable: false
Expand Down
4 changes: 2 additions & 2 deletions source/crud/query/query-filter.txt
Original file line number Diff line number Diff line change
Expand Up @@ -586,12 +586,12 @@ bitwise operations and the equivalent {+mdb-server+} operators:
- {+mdb-server+} Operator

* - ``BitsAllClear()``
- Matches documents where all of the specified bit positions are clear (``0``) in
- Matches documents where all the specified bit positions are clear (``0``) in
the specified field.
- :manual:`$bitsAllClear </reference/operator/query/bitsAllClear/>`

* - ``BitsAllSet()``
- Matches documents where all of the specified bit positions are set (``1``) in
- Matches documents where all the specified bit positions are set (``1``) in
the specified field.
- :manual:`$bitsAllSet </reference/operator/query/bitsAllSet/>`

Expand Down
4 changes: 2 additions & 2 deletions source/data-formats/bson.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ write to a file, perform the following steps:
#. For each BSON document and subdocument you want to create, call
``WriteStartDocument()``.
#. Within each BSON document and subdocument, call ``WriteName()`` to set the field
name and the appropriate ``Write*`` method to set its value. Each data type has a
dedicated ``Write*`` method that you should use.
name and the appropriate ``Write*`` method to set its value. Use the
dedicated ``Write*`` method that corresponds to each data type.
#. To start and end arrays, use ``WriteStartArray()`` and ``WriteEndArray()``.
#. At the end of each document and subdocument, call ``WriteEndDocument()``.

Expand Down
12 changes: 6 additions & 6 deletions source/data-formats/custom-types/class-mapping.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Overview
--------

In this guide, you can learn how to customize the way the {+driver-long+}
maps BSON documents to and from {+language+} classes. You should read this page
to learn more about the default class mapping behavior, or if you need to
maps BSON documents to and from {+language+} classes. Read this page
to learn more about the default class mapping behavior, or if you must
customize the way the driver serializes or deserializes your data.

Automatic Class Mapping
Expand All @@ -35,7 +35,7 @@ the name of the field in the document to the name of the property in the class.

.. important::

The type of the property in your class should match the type of the field in
Match the type of the property in your class to the type of the field in
the document. The {+driver-short+} instantiates a serializer based on the
type of the property in your class. If the types don't match when the driver
attempts to deserialize the data, the serializer throws an exception.
Expand Down Expand Up @@ -72,7 +72,7 @@ class:
.. important::

You must register a class map *before* it's needed in your code. We recommend
registering class maps prior to initializing a connection with MongoDB.
registering class maps before initializing a connection with MongoDB.

You can also manually map a subset of class properties, while still
allowing the driver to automatically map the remaining properties. To do this,
Expand Down Expand Up @@ -241,11 +241,11 @@ You can also support extra elements when initializing a class map as follows:
Dynamically Serialize Properties
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can use a method to determine whether or not to serialize a property. For
You can use a method to determine whether to serialize a property. For
the driver to automatically use the method when serializing, you must prefix the
method name with ``ShouldSerialize`` followed by the name of the property that
the method applies to. When the driver sees a method with this naming
convention, it uses that method to determine whether or not to serialize
convention, it uses that method to determine whether to serialize
properties that have the provided property name.

The following example creates a method that only serializes the ``Age`` property
Expand Down
7 changes: 3 additions & 4 deletions source/data-formats/custom-types/poco.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ features from any framework-specific base classes or interfaces. We recommend
using POCOs in your {+language+} code to adhere to idiomatic driver usage and
achieve the best performance.

You should read this guide if you want to learn more about how to use
POCOs with the {+driver-short+} or if you need to adjust the driver's default
Read this guide if you want to learn more about how to use
POCOs with the {+driver-short+} or if you must adjust the driver's default
field mapping behavior.

Create a POCO
Expand Down Expand Up @@ -84,8 +84,7 @@ Custom Serialization
If the default field mapping behavior does not meet your needs, you can
specify custom behavior using serialization-related attributes. These
attributes change the way that the driver serializes each property of
your POCO. This section describes some of the common
serialization-related attributes.
your POCO. This section describes some common serialization-related attributes.

Serialize Read-Only Properties
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
6 changes: 3 additions & 3 deletions source/data-formats/custom-types/serialization.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ you can pass in a delegate of type ``Func<Type, bool>``. This delegate
accepts an object type and returns a boolean value indicating whether the
type is safe for serialization.

In most cases, you should pass in the ``ObjectSerializer.DefaultAllowedTypes()``
delegate. This method returns true for a number of well-known
In most cases, pass in the ``ObjectSerializer.DefaultAllowedTypes()``
delegate. This method returns true for several well-known
framework types that we have deemed safe. To serialize custom types,
create a boolean expression that evaluates to ``true`` for the
types you want to include. Then, add this expression to the end of the
Expand All @@ -81,7 +81,7 @@ as shown in the following example:
|| type.FullName.StartsWith("<>f__AnonymousType"));
BsonSerializer.RegisterSerializer(objectSerializer);

You should create and register your ``ObjectSerializer`` at the start of your program,
Create and register your ``ObjectSerializer`` at the start of your program,
before doing anything else.

Serializer Registry
Expand Down
Loading
Loading