停止mongodb动态创建数据库和集合 [英] stop mongodb creating dbs and collections dynamically

查看:237
本文介绍了停止mongodb动态创建数据库和集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以关闭mongo一旦在查询中看到一个就偶尔创建数据库和集合的功能.我一直在mongo控制台上运行查询,并错误输入数据库或集合名称,导致mongo仅创建一个.应该有一个开关,使mongo只显式地创建数据库和集合.我在文档中找不到一个.

Is there a way to switch off the ability of mongo to sporadically create dbs and collections as soon as it sees one in a query. I run queries on the mongo console all the time and mistype a db or collection name, causing mongo to just create one. There should be a switch to have mongo only explicitly create dbs and collections. I can't find one on the docs.

推荐答案

否,隐式创建集合和数据库是控制台的功能,不能禁用.您可能会看一下2.6和更高版本的 security/authorization/role 功能看看是否有任何帮助(尽管据我所知,没有任何东西完全符合您的要求).

No, implicit creation of collections and DBs is a feature of the console and may not be disabled. You might take a look at the security/authorization/role features of 2.6 and see if anything might help (although there's not something that exactly matches your request as far as I know).

我建议在此处浏览MongoDB的Issues/bug/requests数据库系统.到功能请求(如果还不存在),还可以选择添加.

I'd suggest looking through the MongoDB issues/bug/requests database system here to and optionally add the feature request if it doesn't already exist.

这篇关于停止mongodb动态创建数据库和集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆