Jimmy,
Thanks for replying and thanks especially for the code. I'll take a very
hard look at this.
There is no reason I can't do it right, I just suffer from a) being new
to this and b) not finding the Java documentation (a reference to which
you've given) sufficiently clear. I think doc tends to be written by
people who don't remember what it was like when they were SQL guys new
to Mongo and so don't remember what it was like to be totally confused.
My biggest challenge has been relating console/JS to Java with respect
to arrays, but I'm starting to get the hang of it. My second biggest
challenge has been to understand the doc in the first place on points
such as this one. The examples that turn up from Googling still tend to
be a bit too simple. That will change over time (for instance, I write
up and publish everything I learn in on-line notes I keep. Eventually,
those will come up in Google for others.)
And, I mean no offense: I wouldn't be abandoning MySQL/PostgreSQL if I
didn't think Mongo was hands-down the best invention since sliced bread.
Profuse thanks,
Russ