delete mongodb data by date(根据日期来查询/删除mongodb )
访问量: 4413
mongoDB 操作起来不是很直观啊。 例如,
# 查询 2014年4月24日之后建立的数据: (find them) start = new Date(2014,3,25); db.logs.find({created_at: { $gt: start}}).count() # => 1254450 # 删除 它们 (remove them) db.logs.remove({created_at: { $lt: start}});