You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @njordr - Have you looked at the Frameless snippet? That's one option, if you implement a Frameless class then there are no restrictions on the fields you can define.
Alternatively you can structure you document like so:
{
"source": "site24",
"locations": {
"1" : "California - US",
"2" : "New Jersey - US",
...
}
}
Here locations become an embedded document instead.
Hi.
How can I map a document like this?
{
"_id" : "locations_names",
"1" : "California - US",
"2" : "New Jersey - US",
"3" : "Singapore - SG",
"4" : "Texas - US",
"5" : "Rotterdam - NL",
"6" : "London - UK",
"7" : "Dallas - US",
"8" : "Seattle - US",
"9" : "Chicago - US",
"10" : "Cologne - DE",
"11" : "Johannesburg - ZA",
"12" : "Melbourne - AUS",
"13" : "Nagano - JP",
"14" : "Shanghai - CHN",
"15" : "Chennai - IN",
"16" : "Rio de Janeiro - BR",
"17" : "Stockholm - SWE",
"18" : "Paris - FR",
"19" : "Virginia - US",
"20" : "Ireland - IE",
"21" : "Hong Kong - HK",
"22" : "Sao Paulo - BR",
"23" : "Barcelona - ES",
"24" : "Milano - IT",
"25" : "New York - US",
"26" : "Los Angeles - US",
"27" : "Denver - US",
"28" : "Kansas - US",
"29" : "Munich - DE",
"30" : "Washington - US",
"31" : "Montreal - CA",
"32" : "Phoenix - US",
"33" : "Mumbai - IN",
"34" : "Istanbul - TR",
"35" : "Tel Aviv - IL",
"36" : "Sydney - AUS",
"37" : "Auckland - NZ",
"38" : "Atlanta - US",
"39" : "Brussels - BE",
"40" : "Toronto - CA",
"41" : "Copenhagen - DA",
"42" : "Vienna - AT",
"43" : "Zurich - CH",
"44" : "Warsaw - PL",
"45" : "Bucharest - RO",
"46" : "Moscow - RU",
"47" : "Beijing - CHN",
"48" : "Hangzhou City - CHN",
"49" : "Qingdao City - CHN",
"50" : "Miami - US",
"52" : "Tokyo - JP",
"55" : "Dubai - UAE",
"56" : "Queretaro - MEX",
"57" : "Falkenstein - DE",
"58" : "Strasbourg - FR",
"59" : "Bengaluru - IN",
"source" : "site24"
}
The fields name are not static and they can grow in the future.
If in the class I only map the ones that are static
class LocationInfo(Frame):
_collection = 'locations_info'
_fields = {
'source'
}
Than I've got only them in the query result
{'_document': {'_id': 'locations_names', 'source': 'site24'}}
Thanks
The text was updated successfully, but these errors were encountered: