× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
JennyNishimura reported 2015-10-06T20:25:58Z  · dutondeumesh last modified 2015-10-15T12:05:35Z

Table Data Editor turns an array field to a string field for MongoDB


customer request
Dev
Jenny Nishimura
JennyNishimura
QA
Ivan Gron
ivangron
Priority Major
Complexity Unknown
Component MongoSQL
Version 16.0

1. In MongoShell, create a collection with an array field that contains a timestamp field.

  > db.arrayCollection.insert( { "_id":"123", "a":[ {"id":"one", "d":ISODate("2015-10-06T12:00:00Z")}, {"id":"two", "d":ISODate("2015-10-06T12:01:00Z")} ] } )

2. Check the field length.  Since there are two entries in the array field, it should return 2.

  > db.arrayCollection.findOne({"_id":"123"}).a.length
  2

3. Bring up the Table Data Editor for the collection and update the array field, e.g. change "one" to "One".  Check the Preview SQL tab and note that the generated UPDATE statement is as follows.  The value of "a" is enclosed in single quotes, making it a string value.

UPDATE "jenny"."arrayCollection"
SET "a"='[ { "id" : ''One'', "d" : ISODate(''2015-10-06T12:00:00.000Z'') }, { "id" : ''two'', "d" : ISODate(''2015-10-06T12:01:00.000Z'') } ]'
WHERE "_id"='123'
GO
 
4. Hit Save and Refresh in the Table Data Editor.  The following message is displayed.
 
Can't refresh the data. The table definition may have been changed. Close the Table Data Editor and reopen.
 

5. In MongoShell, check the field length again.

  > db.arrayCollection.findOne({"_id":"123"}).a.length
  124

6. Check the schema browser or run a SHOW FIELDS command for arrayCollection.  Field "a" has become a "string" field.

5 attachments

Issue #13770

Closed
Fixed
Resolved 2015-10-08T20:28:02Z
 
 
Completion
No due date
Fixed Build ADS 15.0.16-2, ADS 16.0.9-2
No time estimate

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