× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
NielsGron reported 2013-04-24T19:09:41Z  · rkshakya last modified 2013-07-16T06:16:08Z

CREATE COLLECTION storage options capped, max, size


Dev
Jenny Nishimura
JennyNishimura
QA
Tariq Rahiman
tariqrahiman
Priority Low
Complexity Unknown
Component MongoSQL
Version 14.0

The CREATE COLLECTION clause does not have any options, but there are 3 options you can pass which are capped, max, size.  See here for a good explanation :

http://www.cs.wcupa.edu/docs/php/mongodb.createcollection.html

"A capped collection is a special type of collection that has either a fixed or a fixed number of elements. Once the collection is "full," the oldest elements will be removed when new elements are added. Capped collections can be very useful for applications like logging, where you may want to reserve a certain amount of space for logs and not worry about them getting too big."

In the Mongo Shell I can do this :>> db.createCollection("app1_log", true, 10*1024, 10)

Other databases like Oracle include storage options like this :

CREATE TABLE HR.COUNTRIES  (
    COUNTRY_ID      CHAR(2) NOT NULL,
    COUNTRY_NAME    VARCHAR2(40) NULL,
    REGION_ID       NUMBER NULL,
    CONSTRAINT COUNTRY_C_ID_PK PRIMARY KEY(COUNTRY_ID)
    NOT DEFERRABLE
USING INDEX
TABLESPACE EXAMPLE PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE( INITIAL 65536 MINEXTENTS 1 MAXEXTENTS 2147483645 BUFFER_POOL DEFAULT )
NOLOGGING
)
NOCOMPRESS
NOPARALLEL
NOCACHE
MONITORING
NOROWDEPENDENCIES
DISABLE ROW MOVEMENT

We should consider adding these 3 options like this :

CREATE COLLECTION [NAME] { CAP | NOCAP } { MAX [AMOUNT] } { SIZE [AMOUNT] }

For the system catalog/show command looks like we can tell if the collection is capped, but not sure if we can tell the MAX and SIZE.  Would be nice if we could tell and show it in the Detail View for the Collections folder node of the tree.

Doesn't look like you can ALTER the options once created.

Issue #8735

Closed
Fixed
Resolved 2013-05-01T16:06:07Z
 
 
Completion
No due date
Fixed Build ADS 14.0-dev-48
No time estimate

About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017