EDIT - See the end of the question for one way to do it:
I have a mongo object with properties like:
{ something: { name: "asdf", childThing: {} } }
and
{ something: { name: "jklh", childThing: {"type": "blah"} } }
How can I write a query that will find the object somethingElse based on the fact that count(somethingElse.childThing.keys) > 0
I tried this but it's only for arrays, I guess, because it returns all records:
{ 'childThing': { $exists: true, $not: {$size: 0} } }
EDIT: I figured out one way to do this:
{ 'something.childThing': { $not: {$eq: {} } } }
This just matches all documents that have a non-empty value for that child