db.myCollection.find( { $where: "this.a1.a != this.a2.a" } )
{ <field1>: <value>, <field2>: <value> ... }