{"action":"created","issue":{"url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1654","repository_url":"https://api.github.com/repos/MongoEngine/mongoengine","labels_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1654/labels{/name}","comments_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1654/comments","events_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1654/events","html_url":"https://github.com/MongoEngine/mongoengine/issues/1654","id":257801812,"node_id":"MDU6SXNzdWUyNTc4MDE4MTI=","number":1654,"title":"Update doesn't work with pull+in query","user":{"login":"werat","id":241450,"node_id":"MDQ6VXNlcjI0MTQ1MA==","avatar_url":"https://avatars0.githubusercontent.com/u/241450?v=4","gravatar_id":"","url":"https://api.github.com/users/werat","html_url":"https://github.com/werat","followers_url":"https://api.github.com/users/werat/followers","following_url":"https://api.github.com/users/werat/following{/other_user}","gists_url":"https://api.github.com/users/werat/gists{/gist_id}","starred_url":"https://api.github.com/users/werat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/werat/subscriptions","organizations_url":"https://api.github.com/users/werat/orgs","repos_url":"https://api.github.com/users/werat/repos","events_url":"https://api.github.com/users/werat/events{/privacy}","received_events_url":"https://api.github.com/users/werat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-14T17:44:29Z","updated_at":"2018-09-06T18:44:57Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Simple example to reproduce:\r\n```python\r\nfrom mongoengine import *\r\nfrom mongoengine.queryset import transform\r\n\r\nclass LisDoc(Document):\r\n    foo = ListField(StringField())\r\n\r\ntransform.update(LisDoc, pull__foo__in=['a'])\r\n```\r\n\r\nFails with the following error:\r\n```python\r\nTraceback (most recent call last):\r\n  File \"fail.py\", line 7, in <module>\r\n    transform.update(LisDoc, pull__foo__in=['a'])\r\n  File \"/.../mongoengine/queryset/transform.py\", line 289, in update\r\n    value = field.prepare_query_value(op, value)\r\n  File \"/.../mongoengine/fields.py\", line 807, in prepare_query_value\r\n    return self.field.prepare_query_value(op, value)\r\n  File \"/.../mongoengine/fields.py\", line 115, in prepare_query_value\r\n    return super(StringField, self).prepare_query_value(op, value)\r\n  File \"/.../mongoengine/base/fields.py\", line 184, in prepare_query_value\r\n    self.validate(value)\r\n  File \"/.../mongoengine/fields.py\", line 80, in validate\r\n    self.error('StringField only accepts string values')\r\n  File \"/.../mongoengine/base/fields.py\", line 159, in error\r\n    raise ValidationError(message, errors=errors, field_name=field_name)\r\nmongoengine.errors.ValidationError: StringField only accepts string values\r\n```\r\n\r\nIt happens because `transform.update` doesn't treat `value` as list-like (iterable) object when `in` is specified."},"comment":{"url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/comments/419200861","html_url":"https://github.com/MongoEngine/mongoengine/issues/1654#issuecomment-419200861","issue_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1654","id":419200861,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTIwMDg2MQ==","user":{"login":"bagerard","id":11854690,"node_id":"MDQ6VXNlcjExODU0Njkw","avatar_url":"https://avatars0.githubusercontent.com/u/11854690?v=4","gravatar_id":"","url":"https://api.github.com/users/bagerard","html_url":"https://github.com/bagerard","followers_url":"https://api.github.com/users/bagerard/followers","following_url":"https://api.github.com/users/bagerard/following{/other_user}","gists_url":"https://api.github.com/users/bagerard/gists{/gist_id}","starred_url":"https://api.github.com/users/bagerard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bagerard/subscriptions","organizations_url":"https://api.github.com/users/bagerard/orgs","repos_url":"https://api.github.com/users/bagerard/repos","events_url":"https://api.github.com/users/bagerard/events{/privacy}","received_events_url":"https://api.github.com/users/bagerard/received_events","type":"User","site_admin":false},"created_at":"2018-09-06T18:44:57Z","updated_at":"2018-09-06T18:44:57Z","author_association":"CONTRIBUTOR","body":"Looks like PR got merged, let's close this"}}
{"actor":{"display_login":"bagerard"}}