Victor Varvaryuk

Results 8 comments of Victor Varvaryuk

Yes, small tabs are difficult to work with.

@lafrech > Indeed, in an ideal world, you'd rather make the checker more clever than adapt the software to the checker's shortcomings. I don't thing adapting a checker to a...

Here is how to use raw query: ``` mongoengine.Q(__raw__={'email': {'$regex': email_pattern}}) ``` But it doesn't work with negation: https://jira.mongodb.org/browse/SERVER-13779

@oblivionguns Does your approach work with regex negation? Because it's MongoDB server limitation.

Wow! Looks like it's working: ``` python In [1]: import mongoengine as me In [2]: import bson.regex In [3]: from *** import User In [4]: User.objects.count() Out[4]: 2548 In [5]:...

Strange that this doesn't work: ``` python In [8]: User.objects(me.Q(email__ne=bson.regex.Regex('example.com$', 'i'))).count() ... OperationFailure: command SON([('count', u'user'), ('fields', None), ('query', {'email': {'$ne': Regex('example.com$', 2)}})]) on namespace brain2.$cmd failed: Can't have regex...

+1 ``` File "/home/jenkins/workspace/***", line 161, in *** self.save(write_concern={'w': 'majority'}) # w: "majority" implies j: true File "/home/jenkins/workspace/***", line 155, in save return super(Document, self).save(*args, **kwargs) File "/home/jenkins/workspace/***/venv/local/lib/python2.7/site-packages/mongoengine/document.py", line 294,...

Although I upgraded to 3.0.9 from 2.4.9 and it worked.