开发者

Limit MongoDB database size?

开发者 https://www.devze.com 2023-02-11 06:59 出处:网络
We\'re interested in deploying MongoDB, but we need to know if we can limit database/table sizes? For example:

We're interested in deploying MongoDB, but we need to know if we can limit database/table sizes?

For example:

db.user1.find() db.user2.find()

As you can see from the above, each user will have their own database. We want to limit each user's database so we don't have any one user eati开发者_高级运维ng up all our hard drive space.

Is this possible with MongoDB?

Thanks.


You can create a database per user and enable the --quota option. This will allow you keep any user from using too much space.

http://docs.mongodb.org/manual/reference/program/mongod/#core-options

http://docs.mongodb.org/manual/faq/storage/#faq-disk-size


Try to

db.createCollection("mycoll", {size:100000})
0

精彩评论

暂无评论...
验证码 换一张
取 消