def test__set_with_positional_operator(self):
        base_document = {"int_field": 1,
                         "list_field": [{"str_field": "a"},
                                        {"str_field": "b"},
                                        {"str_field": "c"}]}

        self.db.collection.insert(base_document)
        self.db.collection.update({"int_field": 1, "list_field.str_field": "b"},
                                  {"$set": {"list_field.$.marker": True}})

        expected_document = copy.deepcopy(base_document)
        expected_document["list_field"][1]["marker"] = True
        self.assertEqual(list(self.db.collection.find()), [expected_document])

        self.db.collection.update({"int_field": 1, "list_field.str_field": "a"},
                                  {"$set": {"list_field.$.marker": True}})

        self.db.collection.update({"int_field": 1, "list_field.str_field": "c"},
                                  {"$set": {"list_field.$.marker": True}})

        expected_document["list_field"][0]["marker"] = True
        expected_document["list_field"][2]["marker"] = True
        self.assertEqual(list(self.db.collection.find()), [expected_document])
.. versionchanged:: 2016.3.0
dataset/ETHPy150Open vmalloc/mongomock/tests/test__collection_api.py/CollectionAPITest.test__set_with_positional_operator--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/zpool.py/detach