Thanks for reply, but $in really doesn't do what I need. As I
understand, {$in:[regex1,regex2]} is equivalent for "matches either
regex1 or regex2", but I need "matches both regex1 *and* regex2", and
$all seems to be the right choice. But apparently it isn't either.
>>> pymongo.version
'1.7'
>>> db.connection.server_info()['version']
u'1.5.3'
>>> db.test.save({"x": "hello world"})
ObjectId('4c3b4080a3baa42f5d000000')
>>> db.test.save({"x": "mongodb"})
ObjectId('4c3b4086a3baa42f5d000001')
>>> db.test.save({"x": "hello mongo"})
ObjectId('4c3b408ea3baa42f5d000002')
>>> list(db.test.find({"x": {"$all": [re.compile("mongo"), re.compile("world")]}}))
[]
I need the "hello mongo" document instead of [] in the last query.
Can I do that somehow? Or maybe it's even a bug that $all doesn't work
that way?
Thanks,
Andy