From c82f4f0d45e6e70bf8410d28415602ddea6794e3 Mon Sep 17 00:00:00 2001 From: Phil Freo Date: Fri, 7 Mar 2014 13:29:29 -0800 Subject: [PATCH] clarifying the 'push' atomic update docs the first time I read this I was all like... "no duh it will remove either the first or the last, but which does it do???" --- docs/guide/querying.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/guide/querying.rst b/docs/guide/querying.rst index 32cbb94e..7168b5e8 100644 --- a/docs/guide/querying.rst +++ b/docs/guide/querying.rst @@ -499,11 +499,13 @@ that you may use with these methods: * ``dec`` -- decrement a value by a given amount * ``push`` -- append a value to a list * ``push_all`` -- append several values to a list -* ``pop`` -- remove the first or last element of a list +* ``pop`` -- remove the first or last element of a list `depending on the value`_ * ``pull`` -- remove a value from a list * ``pull_all`` -- remove several values from a list * ``add_to_set`` -- add value to a list only if its not in the list already +.. _depending on the value: http://docs.mongodb.org/manual/reference/operator/update/pop/ + The syntax for atomic updates is similar to the querying syntax, but the modifier comes before the field, not after it::