         return keys
     }
     
+    public var dictionaryValue: [String: Value] {
+        var dictionary = [String: Value]()
+        
+        for pos in makeKeyIterator() {
+            if let key = String(bytes: pos.keyData, encoding: NSUTF8StringEncoding) {
+                
+                let value = getValue(atDataPosition: pos.dataPosition, withType: pos.type)
+                
+                dictionary[key] = value
+            }
+        }
+        
+        return dictionary
+    }
+    
+    public var arrayValue: [Value] {
+        var array = [Value]()
+        
+        for pos in makeKeyIterator() {
+            let value = getValue(atDataPosition: pos.dataPosition, withType: pos.type)
+            
+            array.append(value)
+        }
+        
+        return array
+    }
+    
     public func validatesAsArray() -> Bool {
         for key in makeKeyIterator() {
             for keyByte in key.keyData where keyByte < 30 || keyByte >= 40 {

            
            storage.removeSubrange(position..<position+length)
            storage.insert(contentsOf: newValue.value.bytes, at: position)
        }
    }
    

    
    public init() {
        // the empty document is 5 bytes long.
        storage = [5,0,0,0,0]
    }
    
    // MARK: - Initialization from Swift Types & Literals
