MySQL-python 在 Ubuntu 上的安装

Pymongo技巧

Ping posted @ 2011年7月02日 19:49 in Python , 1117 阅读

用_id查询

from pymongo.objectid import ObjectId

...


posts.find_one({'_id':ObjectId(_id)})

降序排列

 

posts.find().sort([('_id',-1)])

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter