File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,17 @@ class Doc(Document):
51
51
update = transform .update (DicDoc , pull__dictField__test = doc )
52
52
self .assertTrue (isinstance (update ["$pull" ]["dictField" ]["test" ], dict ))
53
53
54
+ def test_transform_update_push (self ):
55
+ """Ensure the differences in behvaior between 'push' and 'push_all'"""
56
+ class BlogPost (Document ):
57
+ tags = ListField (StringField ())
58
+
59
+ update = transform .update (BlogPost , push__tags = ['mongo' , 'db' ])
60
+ self .assertEqual (update , {'$push' : {'tags' : ['mongo' , 'db' ]}})
61
+
62
+ update = transform .update (BlogPost , push_all__tags = ['mongo' , 'db' ])
63
+ self .assertEqual (update , {'$push' : {'tags' : {'$each' : ['mongo' , 'db' ]}}})
64
+
54
65
def test_query_field_name (self ):
55
66
"""Ensure that the correct field name is used when querying.
56
67
"""
You can’t perform that action at this time.
0 commit comments