Skip to content

na #1316

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

Closed
wants to merge 44 commits into from
Closed

na #1316

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
036ae07
2.6 rel notes
kay-kim Sep 23, 2013
d14fbf3
relnotes2.6 docs-1836
kay-kim Sep 23, 2013
187ec5b
2.6 rel notes DOCS-1982 for quiet option
kay-kim Sep 24, 2013
555d71a
2.6 rel notes specify enterprise version for auditing
kay-kim Sep 25, 2013
2c533ee
2.6 rel notes update mul with missing fields
kay-kim Sep 25, 2013
f183a40
DOCS-215 new explain field in the aggregation pipeline
Sep 24, 2013
5ccb841
2.6 relnotes DOCS-1950 mongoimport uses filename when collection unsp…
kay-kim Sep 26, 2013
2b79bca
2.6 relnotes DOCS-1981 msi package for windows
kay-kim Sep 26, 2013
459fddf
DOCS-1835 cursor on aggregation
Sep 26, 2013
287c3b9
2.6 rel notes minor tweaks to agg explain
kay-kim Sep 27, 2013
25b1c49
DOCS-1921, strong ciphers
Sep 27, 2013
0d8e86f
rel-notes: update organization slightly
Sep 27, 2013
0513484
DOCS-1941 support for mixed ssl modes on a connection
Sep 27, 2013
1c1a97e
2.6 rel notes DOCS-1944 rs.printReplicationInfo and rs.printSlaveRepl…
kay-kim Sep 27, 2013
e7a7dd0
rel-notes: organization of page
Sep 27, 2013
d02efd1
rel-notes: organization
Sep 27, 2013
53b72df
2.6 relnotes DOCS-2003 update example in x.509
kay-kim Sep 27, 2013
1ef83ed
2.6 rel notes tweak examples from last commit
kay-kim Sep 27, 2013
dedde5d
2.6 rel notes: DOCS-1948 entered but commented out
kay-kim Sep 27, 2013
fbcf40d
DOCS-1941 support for mixed ssl modes on a connection
Sep 27, 2013
42c5929
2.6 rel notes move sslMode option section before upgrade section
kay-kim Sep 30, 2013
bc33a4d
2.6 relnotes DOCS-1984 alternate password entry for PEM key
Sep 30, 2013
5a98265
2.6 rel notes fix let example
kay-kim Oct 1, 2013
4c225fc
2.6 relnotes DOCS-1920 cond accepts object
Oct 1, 2013
63eb6f2
DOCS-1920: edits
Oct 1, 2013
11673c4
2.6 rel notes DOCS-1949 new size operator
Oct 3, 2013
8ec21a1
DOCS-1949 edits
Oct 3, 2013
63c97e4
DOCS-1923: multiple member votes deprecated
Oct 1, 2013
e12c03f
DOCS-1923: edits
Oct 3, 2013
4f58125
2.6 rel notes DOCS-1949 example for size operator
Oct 3, 2013
6b59832
2.6 rel notes no ldap support in mongodb enterprise for windows
kay-kim Oct 3, 2013
4d25cd0
2.6 rel notes DOCS-2012 min and max update operators
kay-kim Oct 1, 2013
068e140
2.6 rel notes DOCS-2013 currentDate update operator
kay-kim Oct 2, 2013
fdba721
2.6 rel notes fix spacing issues
kay-kim Oct 3, 2013
172c263
2.6 rel notes DOCS-1940 write operation wire protocol changes
kay-kim Oct 3, 2013
72d4c94
DOCS-1733 no hard limit on maxConns
Oct 3, 2013
9ce9b58
DOCS-1733: change wroding
Oct 4, 2013
c8f804d
DOCS-1995 mul update operator
kay-kim Oct 3, 2013
0fc5d20
DOCS-1995 fix s+v agreement bug
kay-kim Oct 4, 2013
24d9587
rn-2.6: adding auth to sasl requirements
Oct 4, 2013
86a16cf
2.6 update redirect for mul
kay-kim Oct 4, 2013
bbf6508
2.6 rel notes DOCS-1925 mongostat --rowcount with --discover
kay-kim Oct 4, 2013
26511e5
DOCS-1950: collection name from filename
Oct 1, 2013
becefed
DOCS-1980, DOCS-1934, DOCS-1935, DOCS-1936 user-defined roles
Oct 7, 2013
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
8 changes: 8 additions & 0 deletions bin/builddata/htaccess.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3130,4 +3130,12 @@ type: 'redirect'
code: 303
outputs:
- 'v2.2'
---
redirect-path: '/reference/operator/mul'
url-base: '/reference/operators/#update'
type: 'redirect'
code: 303
outputs:
- 'v2.2'
- 'v2.4'
...
14 changes: 8 additions & 6 deletions source/core/replica-set-elections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,14 @@ distributed replica set
adjust priorities so that only members in a specific data center can
become primary.

The first member to receive the majority of votes becomes primary. By
default, all members have a single vote, unless you modify the
:data:`~local.system.replset.members[n].votes`
setting. :doc:`Non-voting members
</tutorial/configure-a-non-voting-replica-set-member>` have
:data:`~local.system.replset.members[n].votes` value of ``0``.
The first member to receive the majority of votes becomes primary.
By default, all members have a single vote, unless you modify the
:data:`~local.system.replset.members[n].votes` setting. :doc:`Non-voting
members </tutorial/configure-a-non-voting-replica-set-member>` have
:data:`~local.system.replset.members[n].votes` value of ``0``. All
other members have ``1`` vote.

.. include:: /includes/members-used-to-allow-multiple-votes.rst

The :data:`~replSetGetStatus.members.state` of a member also affects
its eligibility to vote. Only members in the following states can
Expand Down
41 changes: 41 additions & 0 deletions source/faq/developers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,47 @@ for additional information.
The :source:`jsobj.h <src/mongo/db/jsobj.h>` source
file for the definition of ``MinKey`` and ``MaxKey``.

.. _faq-developers-multiplication-type-conversion:

When multiplying values of mixed types, what type conversion rules apply?
-------------------------------------------------------------------------

The :operator:`$mul` multiplies the numeric value of a field by a
number. For multiplication with values of mixed numeric types (32-bit
integer, 64-bit integer, float), the following type conversion rules
apply:

.. list-table::
:header-rows: 1

* -
- 32-bit Integer
- 64-bit Integer
- Float

* - **32-bit Integer**
- 32-bit or 64-bit Integer
- 64-bit Integer
- Float

* - **64-bit Integer**
- 64-bit Integer
- 64-bit Integer
- Float

* - **Float**
- Float
- Float
- Float

.. note::

- If the product of two 32-bit integers exceeds the maximum value
for a 32-bit integer, the result is a 64-bit integer.

- Integer operations of any type that exceed the maximum value for a
64-bit integer produce an error.

.. _faq-developers-query-for-nulls:

How do I query for fields that have null values?
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. note:: MongoDB Enterprise for Windows does **not** include LDAP
support for authentication.
11 changes: 11 additions & 0 deletions source/includes/members-used-to-allow-multiple-votes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. note::

.. deprecated:: 2.5.3
:data:`~local.system.replset.members[n].votes` values greater
than ``1``.

Earlier versions of MongoDB allowed a member
to have more than ``1`` vote by setting
:data:`~local.system.replset.members[n].votes` to a value greater
than ``1``. Setting :data:`~local.system.replset.members[n].votes`
to value greater than ``1`` now produces a warning message.
7 changes: 5 additions & 2 deletions source/includes/note-max-conns-max.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.. note:: You cannot set :setting:`maxConns` to a value higher
than `20000`.
.. note::

.. versionchanged:: 2.5.0
MongoDB removed the upward limit on the :setting:`maxConns`
setting.
4 changes: 4 additions & 0 deletions source/includes/ref-toc-operator-update-field.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: ":operator:`$inc`"
file: /reference/operator/inc
description: "Increments the value of the field by the specified amount."
---
name: ":operator:`$mul`"
file: /reference/operator/mul
description: "Multiplies the value of the field by the specified amount."
---
name: ":operator:`$rename`"
file: /reference/operator/rename
description: "Renames a field."
Expand Down
115 changes: 115 additions & 0 deletions source/reference/operator/mul.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
====
$mul
====

.. default-domain:: mongodb

.. operator:: $mul

.. versionadded:: 2.6

Multiply the value of a field by a number. To specify a
:operator:`$mul` expression, use the following prototype:

.. code-block:: javascript

{ field: { $mul: <number> } }

The field to update must contain a numeric value. If the field does
not exist in a document, :operator:`$mul` creates the field and sets
the value to zero of the same numeric type as the multiplier.

Multiplication with values of mixed numeric types (32-bit integer,
64-bit integer, float) may result in conversion of numeric type. See
:ref:`Multiplication Type Conversion Rules
<faq-developers-multiplication-type-conversion>` for details.

Examples
--------

Multiply the Value of a Field
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Consider a collection ``products`` with the following document:

.. code-block:: javascript

{ _id: 1, item: "ABC", price: 10.99 }

The following :method:`db.collection.update()` operation updates the
document, using the :operator:`$mul` operator to multiply the value in
the ``price`` field by ``1.25``:

.. code-block:: javascript

db.products.update(
{ _id: 1 },
{ $mul: { price: 1.25 } }
)

The operation results in the following document, where the new value of
the ``price`` field ``13.7375`` reflects the original value ``10.99``
multiplied by ``1.25``:

.. code-block:: javascript

{ _id: 1, item: "ABC", price: 13.7375 }

Apply ``$mul`` Operator to a Non-existing Field
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Consider a collection ``products`` with the following document:

.. code-block:: javascript

{ _id: 2, item: "Unknown" }

The following :method:`db.collection.update()` operation updates the
document, applying the :operator:`$mul` operator to the field ``price``
that does not exist in the document:

.. code-block:: javascript

db.products.update(
{ _id: 2 },
{ $mul: { price: NumberLong(100) } }
)

The operation results in the following document with a ``price`` field
set to value 0 of numeric type :ref:`shell-type-long`, the same type as
the multiplier:

.. code-block:: javascript

{ "_id" : 2, "item" : "Unknown", "price" : NumberLong(0) }

Multiply Mixed Numeric Types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Consider a collection ``products`` with the following document:

.. code-block:: javascript

{ _id: 3, item: "XYZ", price: NumberLong(10) }

The following :method:`db.collection.update()` operation uses the
:operator:`$mul` operator to multiply the value in the ``price`` field
:ref:`NumberLong(10) <shell-type-long>` by :ref:`NumberInt(5)
<shell-type-int>`:

.. code-block:: javascript

db.products.update(
{ _id: 3 },
{ $mul: { price: NumberInt(5) } }
)

The operation results in the following document:

.. code-block:: javascript

{ "_id" : 3, "item" : "XYZ", "price" : NumberLong(50) }

The value in the ``price`` field is of type :ref:`shell-type-long`. See
:ref:`Multiplication Type Conversion Rules
<faq-developers-multiplication-type-conversion>` for details.
16 changes: 11 additions & 5 deletions source/reference/program/mongoimport.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,17 @@ Options
data directory: as a result, no :program:`mongod` can access the
same path while the process runs.

.. option:: --collection <collection>, -c <collection>

Use the :option:`--collection` option to specify the collection
that you want :program:`mongoimport` to import.

.. versionadded:: 2.5.3
If you do not specify :option:`--collection`,
:program:`mongoimport` takes the collection name from the input
filename. MongoDB omits the extension of the file from the
collection name, if the input file has an extension.

.. option:: --directoryperdb

Use the :option:`--directoryperdb` in conjunction with the
Expand All @@ -142,11 +153,6 @@ Options
Use the :option:`--db` option to specify a database for
:program:`mongoimport` to import data.

.. option:: --collection <collection>, -c <collection>

Use the :option:`--collection` option to specify a collection for
:program:`mongoimport` to import.

.. option:: --fields <field1<,field2>>, -f <field1[,field2]>

Specify a comma separated list of field names when importing
Expand Down
14 changes: 8 additions & 6 deletions source/reference/program/mongorestore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,14 @@ Options

.. option:: --collection <collection>, -c <collection>

Use the :option:`--collection` option to specify a collection for
:program:`mongorestore` to restore. If you do not specify a
``<collection>``, :program:`mongorestore` imports all collections
created. Existing data may be overwritten. Use this option to
restore data into a MongoDB instance that already has data, or to
restore only some data in the specified imported data set.
Use the :option:`--collection` option to specify a single collection
for :program:`mongorestore` to restore. :program:`mongorestore` will
restore only that single collection.

If you do not specify :option:`--collection`, :program:`mongorestore`
takes the collection name from the input filename. MongoDB omits the
extension of the file from the collection name, if the input file has
an extension.

.. option:: --objcheck

Expand Down
11 changes: 5 additions & 6 deletions source/reference/replica-configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,13 @@ Configuration Variables

Controls the number of votes a server will cast in a :ref:`replica set
election <replica-set-elections>`. The number of votes each member
has can be any non-negative integer, but it is highly recommended
each member has 1 or 0 votes.
has can be either ``1`` or ``0``.

If you need more than 7 members in one replica set, use this setting to add additional
non-voting members with a :data:`~local.system.replset.members[n].votes` value of ``0``.
If you need more than 7 members in one replica set, set
:data:`~local.system.replset.members[n].votes` to ``0`` for
the additional non-voting members.

For most deployments and most members, use the default value,
``1``, for :data:`~local.system.replset.members[n].votes`.
.. include:: /includes/members-used-to-allow-multiple-votes.rst

.. data:: local.system.replset.settings

Expand Down
Loading