def _add_samples_batch(self, samples_and_docs):
        """Writes the given samples and backing docs to the database and
        returns their IDs.

        Args:
            samples_and_docs: a list of tuples of the form ``(sample, dict)``,
                where the dict is the sample's backing document

        Returns:
            a tuple of

            -   ``pymongo.results.InsertManyResult``
            -   a list of IDs of the samples that were added to this dataset
        """
        dicts = [doc for _, doc in samples_and_docs]
        try:
            # adds `_id` to each dict
            res = self._sample_collection.insert_many(dicts)
        except BulkWriteError as bwe:
            msg = bwe.details["writeErrors"][0]["errmsg"]
            raise ValueError(msg) from bwe

        for sample, d in samples_and_docs:
            doc = self._sample_dict_to_doc(d)
            sample._set_backing_doc(doc, dataset=self)
            if sample.media_type == fom.VIDEO:
                sample.frames.save()

        return (res, [str(d["_id"]) for d in dicts])
Writes the given samples and backing docs to the database and
        returns their IDs.

        Args:
            samples_and_docs: a list of tuples of the form ``(sample, dict)``,
                where the dict is the sample's backing document

        Returns:
            a tuple of

            -   ``pymongo.results.InsertManyResult``
            -   a list of IDs of the samples that were added to this dataset
        
fiftyone/core/dataset.py