org.springframework.data.mongodb.core

Interface CollectionCallback<T>



  • public interface CollectionCallback<T>
    Callback interface for executing actions against a MongoCollection.
    Since:
    1.0
    Author:
    Mark Pollak, Grame Rocher, Oliver Gierke, John Brisbin
    • Method Detail

      • doInCollection

        @Nullable
        T doInCollection(com.mongodb.client.MongoCollection<org.bson.Document> collection)
                            throws com.mongodb.MongoException,
                                   DataAccessException
        Parameters:
        collection - never null.
        Returns:
        can be null.
        Throws:
        com.mongodb.MongoException
        DataAccessException