关键词: expireAfterSeconds.TTL TTL Time to Live 类似Redis中的expire机制,MongoDB也可以设置过期自动删除的表. MongoDB的过期设置依赖索引(TTL-index),设置过期字段使用的索引后,插入数据时在该字段指定日期时间, 经过在创建索引时指定的秒数后,该记录会被MongoDB认为已经过期,然后删除. JS版 db.test_timer.createIndex({"timer":1}, {expireAfterSeconds
Mongodb教程的说明,可以当手册用 Getting Started Install MongoDB on Linux Systems Install MongoDB on Red Hat Enterprise, CentOS, or Fedora Install MongoDB on Debian Install MongoDB on Ubuntu Install MongoDB on OS X Install MongoDB on Windows Getting Started with