@@ -43,7 +43,7 @@ util.inherits(DynamoBackup, events.EventEmitter);
4343DynamoBackup . prototype . listTables = function ( callback ) {
4444 var self = this ;
4545 self . _fetchTables ( null , [ ] , callback ) ;
46- }
46+ } ;
4747
4848DynamoBackup . prototype . backupTable = function ( tableName , backupPath , callback ) {
4949 var self = this ;
@@ -115,7 +115,7 @@ DynamoBackup.prototype.backupTable = function (tableName, backupPath, callback)
115115 }
116116 }
117117 ) ;
118- }
118+ } ;
119119
120120DynamoBackup . prototype . backupAllTables = function ( callback ) {
121121 var self = this ;
@@ -143,13 +143,13 @@ DynamoBackup.prototype.backupAllTables = function (callback) {
143143 callback
144144 ) ;
145145 } ) ;
146- }
146+ } ;
147147
148148DynamoBackup . prototype . _getBackupPath = function ( ) {
149149 var self = this ;
150150 var now = moment . utc ( ) ;
151151 return self . backupPath || ( 'DynamoDB-backup-' + now . format ( 'YYYY-MM-DD-HH-mm-ss' ) ) ;
152- }
152+ } ;
153153
154154DynamoBackup . prototype . _copyTable = function ( tableName , itemsReceived , callback ) {
155155 var self = this ;
@@ -164,7 +164,7 @@ DynamoBackup.prototype._copyTable = function (tableName, itemsReceived, callback
164164
165165 self . _streamItems ( tableName , null , limit , itemsReceived , callback ) ;
166166 } ) ;
167- }
167+ } ;
168168
169169DynamoBackup . prototype . _streamItems = function fetchItems ( tableName , startKey , limit , itemsReceived , callback ) {
170170 var self = this ;
@@ -191,7 +191,7 @@ DynamoBackup.prototype._streamItems = function fetchItems(tableName, startKey, l
191191 }
192192 self . _streamItems ( tableName , data . LastEvaluatedKey , limit , itemsReceived , callback ) ;
193193 } ) ;
194- }
194+ } ;
195195
196196DynamoBackup . prototype . _fetchTables = function ( lastTable , tables , callback ) {
197197 var self = this ;
@@ -228,6 +228,10 @@ DynamoBackup.prototype._formatForDataPipeline = function (item) {
228228 var dataPipelineValueKey = self . _getDataPipelineAttributeValueKey ( k ) ;
229229 value [ dataPipelineValueKey ] = v ;
230230 value [ k ] = undefined ;
231+ // for MAps and Lists, recurse until the elements are created with the correct case
232+ if ( k === 'M' || k === 'L' ) {
233+ self . _formatForDataPipeline ( v ) ;
234+ }
231235 } ) ;
232236 } ) ;
233237 return JSON . stringify ( item ) ;
@@ -241,8 +245,9 @@ DynamoBackup.prototype._getDataPipelineAttributeValueKey = function (type) {
241245 case 'M' :
242246 case 'L' :
243247 case 'NULL' :
244- case 'BOOL' :
245248 return type . toLowerCase ( ) ;
249+ case 'BOOL' :
250+ return 'bOOL' ;
246251 case 'SS' :
247252 return 'sS' ;
248253 case 'NS' :
@@ -252,6 +257,6 @@ DynamoBackup.prototype._getDataPipelineAttributeValueKey = function (type) {
252257 default :
253258 throw new Error ( 'Unknown AttributeValue key: ' + type ) ;
254259 }
255- }
260+ } ;
256261
257262module . exports = DynamoBackup ;
0 commit comments