He probably means the number of objects of that type.
As far as I know it's not possible, so you'll need to query objects in a loop until you find the first one that's undefined (or null or whatever the witness_node returns for objects that don't exist)