From 2deb9a6eec07c2677486b76ac456af858a8b1b23 Mon Sep 17 00:00:00 2001 From: sperelson Date: Thu, 16 May 2013 12:00:53 +0300 Subject: [PATCH] An array identifying field must appear last in the query argument Discovered that if there is any ambiguity with fields in the query argument, the array element that is identified will not be updated. Unless the specific array field that identifies the array element is the last item in the query argument. --- source/core/update.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core/update.txt b/source/core/update.txt index 0e2e5de842f..1bae1927572 100644 --- a/source/core/update.txt +++ b/source/core/update.txt @@ -171,8 +171,8 @@ Update an Element without Specifying Its Position The :method:`~db.collection.update()` method can perform the update using the :operator:`$` positional operator if the position is -not known. The array field must appear in the ``query`` argument in -order to determine which array element to update. +not known. The array field must appear in the ``query`` argument as +the last item in order to determine which array element to update. The following operation queries the ``bios`` collection for the first document where the ``_id`` field equals ``3`` and the ``contribs``