Package com.mongodb

Class DefaultDBCallback

    • Constructor Detail

      • DefaultDBCallback

        public DefaultDBCallback​(DBCollection collection)
        Creates a new DefaultDBCallback. If the Collection is null, it uses DBCollectionObjectFactory to create documents, otherwise it uses the collection's object factory.
        Parameters:
        collection - an optionally null Collection that the documents created by this callback belong to.
    • Method Detail

      • create

        public BSONObject create​(boolean array,
                                 List<String> path)
        Description copied from class: BasicBSONCallback
        Helper method to create either a BSON Object or a BSON List depending upon whether the array parameter is true or not.
        Overrides:
        create in class BasicBSONCallback
        Parameters:
        array - set to true to create a new BSON List, otherwise will create a new BSONObject
        path - a list of field names to navigate to this field in the document
        Returns:
        the new BSONObject