Created
February 1, 2012 14:31
-
-
Save Alex-Ikanow/1717326 to your computer and use it in GitHub Desktop.
Example objects causing type robustness problems
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First document | |
{ | |
"_id": "4f2723ae4f3625d892f5faf4", | |
"title": "Profile 1", | |
// Lots of other completely mapped fields, including arrays of objects, geo points, strings etc | |
"metadata": { // metadata does not have a mapping | |
"socialnetworkobject": [ | |
{ | |
"field1": {}, // <-- THIS CAUSES THE PROBLEM WHEN A DOC WITH A STRING VALUE HERE IS INSERTED | |
"field2": "Blah", | |
"industry": "Telecommunications", | |
"empty_array_of_fields": [], | |
"array_of_fields": [ | |
"val1", | |
"val2" | |
], | |
"name": "Person", | |
"location": "USA", | |
"location_type": "Country" | |
} | |
] | |
} | |
} | |
// Second document | |
{ | |
"_id": "4f2723ae4f3625d892f5faf5", | |
"title": "Profile 2", | |
// Lots of other completely mapped fields, including arrays of objects, geo points, strings etc | |
"metadata": { // metadata does not have a mapping | |
"socialnetworkobject": [ | |
{ | |
"field1": "Blah", // <--- HANGS | |
"field2": "Blah", | |
"industry": "Telecommunications", | |
"empty_array_of_fields": [], | |
"array_of_fields": [ | |
"val1", | |
"val2" | |
], | |
"name": "Person", | |
"location": "USA", | |
"location_type": "Country" | |
} | |
] | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment