Function queryObjects