Aqua Data Studio 17.0.0-rc-37
Build #: 47068
Built on: 2015-Nov-17 03:24:49 PM
Steps:
1] Open Query Analyzer(MongoJS), execute below script to create collection.
db.client.insert({name:"aquafold"})
Scenario A] - Alter Command - shows MissingTokenException
2] Open Query Analyzer(SQL), execute below Alter collection command,
It shows below exception - <--Issue
Please refer screenshot- 1AlterCommand.png
3] 'client' collection is created. Right click on collection, select 'Alter Collection' option
4] In Storage Tab, Check Capped option
- Click Storage Size drop down list, Pop up is displayed.
In Pop up select Unit as Megabytes(MB) from drop down list, and enter value as 10
Click OK button. Value displayed as : 10485760 Bytes .
- Click on Max Number of Documents field - textbox- The textbox is disabled. <--Issue
Expected: Max Number of Documents field - textbox field should be enabled.
5] On Query Analyzer(MongoJS), execute below script to Alter collection- convert collection to capped. It works properly.
In above command - 'max' indicates Max Number of Documents
Please refer screenshot2.png
|
106 KB
|
178 KB
Your ALTER COLLECTION statement is invalid.
The correct syntax of ALTER COLLECTION as you indicated at the bottom of the issue description is:
ALTER COLLECTION collection_name
CAPPED SIZE sizeInBytes
Scenario A] You specified MAX_CAP in the ALTER COLLECTION. Therefore, an exception is thrown. MAX_CAP can be specified in CREATE COLLECTION but not in ALTER COLLECTION.
Scenario B] MAX_CAP is not allowed in ALTER COLLECTION. Therefore, the Max Number of Documents text box is disabled.
5] Although the "convertToCapped" command is run successfully, if you check the collection properties, you will notice that the max number of documents is not updated.
@Jenny:
5] Although the "convertToCapped" command is run successfully, if you check the collection properties, you will notice that the max number of documents is not updated.
Anil--> Please refer attached screenshot2 , After executing "convertToCapped" command, again I opened Alter Table- Storage Tab, it's observed that - Max Number of Documents field value is updated properly.
Scenario A] You specified MAX_CAP in the ALTER COLLECTION. Therefore, an exception is thrown. MAX_CAP can be specified in CREATE COLLECTION but not in ALTER COLLECTION.
Anil-->Since we are able to do this through MongoShell script, we should be able to do it using MongoSQL Command :
ALTER COLLECTION "client" CAPPED SIZE 10485760 MAX_CAP 500
@Jenny:
5] Although the "convertToCapped" command is run successfully, if you check the collection properties, you will notice that the max number of documents is not updated.
Anil--> Please refer attached screenshot2 , After executing "convertToCapped" command, again I opened Alter Table- Storage Tab, it's observed that - Max Number of Documents field value is updated properly.
Scenario A] You specified MAX_CAP in the ALTER COLLECTION. Therefore, an exception is thrown. MAX_CAP can be specified in CREATE COLLECTION but not in ALTER COLLECTION.
Anil-->Since we are able to do this through MongoShell script, we should be able to do it using MongoSQL Command :
ALTER COLLECTION "client" CAPPED SIZE 10485760 MAX_CAP 500
This is working correctly unless I misunderstand what you are reporting.
1. Alter Collection Dialog
- In the Alter Collection dialog, check the Capped checkbox and specify Storage Size. Click Alter.
- Now go to the Collection Properties dialog, note that the Max Number of Documents is now 9223372036854775807.
2. convertToCapped command
- Run the convertToCapped command with max : 5000
- Now go to the Collection Properties dialog, note that the Max Number of Documents is also 9223372036854775807 (as shown in your screenshot).
Basically, you cannot specify the max number of documents when converting a collection to capped. That's why the ALTER COLLECTION statement and the Alter Collection dialog don't need to specify the max number of documents. Otherwise, it is confusing to the user that the max value can be updated.
I think that this issue should be marked as invalid.
This is working correctly unless I misunderstand what you are reporting.
1. Alter Collection Dialog
- In the Alter Collection dialog, check the Capped checkbox and specify Storage Size. Click Alter.
- Now go to the Collection Properties dialog, note that the Max Number of Documents is now 9223372036854775807.
2. convertToCapped command
- Run the convertToCapped command with max : 5000
- Now go to the Collection Properties dialog, note that the Max Number of Documents is also 9223372036854775807 (as shown in your screenshot).
Basically, you cannot specify the max number of documents when converting a collection to capped. That's why the ALTER COLLECTION statement and the Alter Collection dialog don't need to specify the max number of documents. Otherwise, it is confusing to the user that the max value can be updated.
I think that this issue should be marked as invalid.
@Jenny:
Thanks for clarification. You are Right.
I checked this with command: db.<collectionName>.stats()
- ALTER COLLECTION statement and the Alter Collection dialog don't need to specify the max number of documents.
I have marked the issue as Invalid and Closed it.
@Jenny:
Thanks for clarification. You are Right.
I checked this with command: db.<collectionName>.stats()
- ALTER COLLECTION statement and the Alter Collection dialog don't need to specify the max number of documents.
I have marked the issue as Invalid and Closed it.
Issue #13867 |
Closed |
Invalid |
Resolved |
Completion |
No due date |
No fixed build |
No time estimate |
1 issue link |
relates to #8735
Issue #8735CREATE COLLECTION storage options capped, max, size |
Your ALTER COLLECTION statement is invalid.
The correct syntax of ALTER COLLECTION as you indicated at the bottom of the issue description is:
ALTER COLLECTION collection_name
CAPPED SIZE sizeInBytes
Scenario A] You specified MAX_CAP in the ALTER COLLECTION. Therefore, an exception is thrown. MAX_CAP can be specified in CREATE COLLECTION but not in ALTER COLLECTION.
Scenario B] MAX_CAP is not allowed in ALTER COLLECTION. Therefore, the Max Number of Documents text box is disabled.
5] Although the "convertToCapped" command is run successfully, if you check the collection properties, you will notice that the max number of documents is not updated.