In Delphi, using TMongoWire, I am trying to save off a company profile with a variable number of phone numbers. I wanted the resulting saved JSON to look like:
{"ourID":"XYZ1",
"Company":"XYZ Company",
"Phones": [{"number":"714-999-9999", "type":"business"},
{"number":"714-987-6533", "type":"cell"}]
}
But I can't seem to figure out how to get the phones into MongoDB. I tried to create the JSON for the phones myself then pass that to the Phones field but what got stored was a string of the JSON, not a JSON array. It looks like:
"Phones":"[{\"Phone\":\"123-456-7890\", \"pType\":\"Home Phone\", \"notes\":\"this is the home phone\"}]"
Any suggestions?
Thanks, Jim