Skip to content

Instantly share code, notes, and snippets.

@Alex-Ikanow
Created February 1, 2012 14:31
Show Gist options
  • Save Alex-Ikanow/1717326 to your computer and use it in GitHub Desktop.
Save Alex-Ikanow/1717326 to your computer and use it in GitHub Desktop.
Example objects causing type robustness problems
// 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