java - confusion about mongodb capped collection -
i new mongodb. here code snippet:
mongoclient mongo = new mongoclient("localhost", 27017); db db = mongo.getdb("testdb"); dbcollection collection = db.getcollection("user");
for db.getcollection("user")
, if there existing collection named "user", return collection. if "user" not exit, getcollection("user")
create new collection. want know type of collection getcollection
create. getcollection
return capped collection?
i have read mongodb manual:
you must create capped collections explicitly using
createcollection()
method.
does mean collection created getcollection
not capped collection?
also want know:
- what max default size dbcollection on 32 bit system?
- what max number of collections within db?
mongodb not create capped collection except through technique describe (it created through api or shell).
max default size collection? around 2gb on 32 bit system. however, 10gen not recommend 32bit build production system (see here).
maximum number of collections bit more complex, , best explained documentation.
Comments
Post a Comment