Manager/GenericDocumentManager.php
public function getMongoIds($objects)
    {
        $ids = [];

        foreach ($objects as $object) {
            $ids[] = new \MongoId($object->getId());
        }

        return $ids;
    }
public function getMongoIds($objects)
    {
        $ids = [];

        foreach ($objects as $object) {
            $ids[] = new \MongoId($object->getId());
        }

        return $ids;
    }
Get array of MongoIds of this objects

@param array $objects

@return array MongoIds array