推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
jinnietsai
V2EX  ›  Python

Python 里面如何使用 Mongdb 创建一个固定的集合。

  •  
  •   jinnietsai · Mar 8, 2014 · 4516 views
    This topic created in 4475 days ago, the information mentioned may be changed or developed.
    3 replies    1970-01-01 08:00:00 +08:00
    nimoqu
        1
    nimoqu  
       Mar 8, 2014
    这是的固定集合指的是什么呢?
    jinnietsai
        2
    jinnietsai  
    OP
       Mar 8, 2014
    @nimoqu 就是指集合大小是固定的,比如只允许插入五十条记录,当满了以后再次向集合里面插入的时候就不允许了。之前在网络上搜索时通过创建fixedcollection,但是自己试了一下,不行。
    lix
        3
    lix  
       Mar 9, 2014
    MongoDB里有Capped Collection, 可以指定大小, 但会用新数据替换旧数据. 在插入之前先查询一下有多少记录, 达到你的上限了就提示不能插入了不就行了?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3094 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 13:44 · PVG 21:44 · LAX 06:44 · JFK 09:44
    ♥ Do have faith in what you're doing.