Open abdelouahabb opened 11 years ago
hi it seems that positional element is broken: in the console:
db.users.find_one({"reset.timr":"AgQGAAAGAQMfBgIdAgEQAQcMBAYIBgIeAgYGAAIG"}, {"reset.$.code":1}) Out[1]: {u'_id': u'abdelouahab_al@yahoo.fr', u'reset': [{u'code': u'2600', u'timr': u'AgQGAAAGAQMfBgIdAgEQAQcMBAYIBgIeAgYGAAIG'}]}
but:
code = yield tornado.gen.Task(db.users.find_one, ({"reset.timr":""AgQGAAAGAQMfBgIdAgEQAQcMBAYIBgIeAgYGAAIG""}, {"reset.$.timr":1})) i got: ([], None)
i tried to remove the positional element:
code = yield tornado.gen.Task(db.users.find_one, ({"reset.timr":tim}))
and i get the document, so as a hack i use:
code[0]["reset"][-1]
Edit: even $elemMatch gets None:
code = yield tornado.gen.Task(db.users.find, ({"reset.timr":tim}, {"reset":{"$elemMatch":{"timr":tim}}}))
hi it seems that positional element is broken: in the console:
but:
i tried to remove the positional element:
and i get the document, so as a hack i use:
Edit: even $elemMatch gets None: