I'm trying to use the MONGO C++ API to process a bunch of records that look like the following... The number of lines in the "Entries" array is variable: it's either 13 or 7.
{ "_id" : ObjectId("541af7a4c9c7450a5a5c7e8e"), "SvId" : "SV120", "UTCTime" : "2014-09-18T15:17:56.541Z", "Interval" : 10, "HPLANC" : "DownlinkA",
"Entries" : [
[ { "IPAddress" : "172.20.10.20" }, { "Port" : 4096 },
{ "MessageCount" : "0" }, { "ByteCount" : "0" } ],
[ { "IPAddress" : "172.20.10.20" }, { "Port" : 4097 },
{ "MessageCount" : "0" }, { "ByteCount" : "0" } ],
[ { "IPAddress" : "172.20.10.20" }, { "Port" : 4098 },
{ "MessageCount" : "0" }, { "ByteCount" : "0" } ],
[ { "IPAddress" : "172.20.10.20" }, { "Port" : 4099 },
{ "MessageCount" : "0" }, { "ByteCount" : "0" } ],
[ { "IPAddress" : "172.20.10.20" }, { "Port" : 4103 },
{ "MessageCount" : "0" }, { "ByteCount" : "0" } ],
[ { "IPAddress" : "172.20.100.10" }, { "Port" : 4102 },
{ "MessageCount" : "0" }, { "ByteCount" : "0" } ],
[ { "IPAddress" : "172.20.100.10" }, { "Port" : 4104 },
{ "MessageCount" : "0" }, { "ByteCount" : "0" } ],
[ { "IPAddress" : "172.20.150.10" }, { "Port" : 4100 },
{ "MessageCount" : "0" }, { "ByteCount" : "0" } ],
[ { "IPAddress" : "172.20.200.10" }, { "Port" : 4100 },
{ "MessageCount" : "0" }, { "ByteCount" : "0" } ],
[ { "IPAddress" : "172.20.200.10" }, { "Port" : 4150 },
{ "MessageCount" : "0" }, { "ByteCount" : "0" } ],
[ { "IPAddress" : "172.20.200.10" }, { "Port" : 4151 },
{ "MessageCount" : "0" }, { "ByteCount" : "0" } ],
[ { "IPAddress" : "172.20.200.10" }, { "Port" : 4152 },
{ "MessageCount" : "0" }, { "ByteCount" : "0" } ],
[ { "IPAddress" : "172.20.200.10" }, { "Port" : 4153 },
{ "MessageCount" : "0" }, { "ByteCount" : "0" } ] ] }
I query the collection based on UTCTime and SvId ... when I get the records back, I'm unsure of how to step thru them all...
Normally, I just get a cursor and loop through the set of returned records with "next()" ... but now I haven an "Entries" field that has either 7 or 13 entries. How do I access each of those items? I'm guessing there must be somekind of "subcursor" that I can use to loop thru those.
I'm looking through the API and examples, but there's not a lot on nested arrays.
Thanks,
Rick
dsuPoint.getFieldDotted("Entries.0.0.IPAddress")
which return "EOO" ... ??? – earnric Sep 18 '14 at 21:31