Skip to content

1940 new write operations #1377

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 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 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
e73df1d
DOCS-1940: New Write Operations
Oct 8, 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
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.
12 changes: 12 additions & 0 deletions source/includes/ref-toc-command-crud.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
name: ":dbcommand:`insert`"
file: /reference/command/insert
description: "Inserts one or more documents."
---
name: ":dbcommand:`update`"
file: /reference/command/update
description: "Updates one or more documents."
---
name: ":dbcommand:`delete`"
file: /reference/command/delete
description: "Deletes one or more documents."
---
name: ":dbcommand:`findAndModify`"
file: /reference/command/findAndModify
description: "Returns and modifies a single document."
Expand Down
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
25 changes: 25 additions & 0 deletions source/reference/command/delete-field-deletes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
object:
name: group
type: command
field:
optional: false
type: field
name: q
type: string
position: 1
description: |
The query that matches documents to delete.
---
object:
name: group
type: command
field:
optional: false
type: field
name: limit
type: integer
position: 3
description: |
The number of matching documents to delete. Defaults to ``1``. A value
of ``0`` means delete all matching documents.
...
50 changes: 50 additions & 0 deletions source/reference/command/delete-field.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
object:
name: group
type: command
field:
optional: false
type: field
name: delete
type: string
position: 1
description: |
The name of the target collection.
---
object:
name: group
type: command
field:
optional: false
type: field
name: deletes
type: array
position: 2
description: |
An array of one or more deletes to perform in the named collection.
---
object:
name: group
type: command
field:
optional: true
type: field
name: ordered
type: boolean
position: 3
description: |
If ``true``, delete all documents in order. If any delete fails,
then do not perform any subsequent daletes. If ``false``, delete
each document individually. Failed deletes do not prevent the rest. Defaults to ``true``.
---
object:
name: group
type: command
field:
optional: true
type: field
name: writeConcern
type: document
position: 4
description: |
A document expressing the write concern of the delete. Defaults to ``w:1``.
...
140 changes: 140 additions & 0 deletions source/reference/command/delete.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
======
delete
======

.. default-domain:: mongodb

Definition
----------

.. dbcommand:: delete

The :dbcommand:`delete` command deletes one or more documents and returns a
document containing the status of all deletes.

The command has the following syntax:

.. code-block:: javascript

{
delete: <collection>,
deletes: [ { q : <query>, limit : <integer> },
{ q : <query>, limit : <integer> },
{ q : <query>, limit : <integer> },
...
],
ordered: <boolean>,
writeConcern: { <write concern> }
}

The :dbcommand:`delete` command takes the following fields:

.. include:: delete-field.rst

Each element of the ``deletes`` array contains the following sub-fields:

.. include:: delete-field-deletes.rst

The top-level ``writeConcern`` field specifies the write concern for
all deletes. See :doc:`/reference/write-concern` for an explanation
of write concern syntax.

Output
------

On success, :dbcommand:`delete` returns a document similar to the
following:

.. code-block:: javascript

{ ok: 1, n: 1 }

On failure, :dbcommand:`delete` returns a document similar to the
following:

.. code-block:: javascript

{
ok: 0,
n: 1,
code: 104,
errmsg: "Could not replicate operation within requested timeout"
}

The returned document contains a subset of the following fields:

.. data:: delete.ok

The return status of the command.

.. data:: delete.n

The number of documents deleted.

.. data:: delete.code

An integer value identifying the cause of failure.

.. data:: delete.errInfo

Structured data about the error, that is both human- and
machine-readable.

.. data:: delete.errmsg

A human-readable description of the cause of failure.

Examples
--------

Single Delete
~~~~~~~~~~~~~

.. example::

Given a ``people`` collection, delete a person in the collection:

.. code-block:: javascript

db.runCommand(
{
delete: "people",
deletes: [ { q: { name: "Sam" }, limit: 1 } ],
ordered: false,
writeConcern: { w: 1 }
}
)

The returned document:

.. code-block:: javascript

{ "ok" : 1, "n" : 0 }

Bulk Delete
~~~~~~~~~~~

.. example::

Now bulk-delete three more people in the collection:

.. code-block:: javascript

db.runCommand(
{
delete: "people",
deletes: [ { q: { name: "Kay" }, limit: 1 },
{ q: { name: "Bob" }, limit: 1 },
{ q: { name: "Zack" }, limit: 1 }
],
ordered: false,
writeConcern: { w: 1 }
}
)

The returned document:

.. code-block:: javascript

{ "ok" : 1, "n" : 3 }

50 changes: 50 additions & 0 deletions source/reference/command/insert-field.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
object:
name: group
type: command
field:
optional: false
type: field
name: insert
type: string
position: 1
description: |
The name of the target collection.
---
object:
name: group
type: command
field:
optional: false
type: field
name: documents
type: array
position: 2
description: |
An array of one or more json documents to insert into the named collection.
---
object:
name: group
type: command
field:
optional: true
type: field
name: ordered
type: boolean
position: 3
description: |
If ``true``, insert all documents in order. If any insert fails,
then do not perform any subsequent inserts. If ``false``, insert
each document in no particular order. Failed inserts do not prevent the rest. Defaults to ``true``.
---
object:
name: group
type: command
field:
optional: true
type: field
name: writeConcern
type: document
position: 4
description: |
A document expressing the write concern of the insert. Defaults to ``w:1``.
...
Loading