Skip navigation links
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Index
  • Help

Deprecated API

Contents

  • Interfaces
  • Classes
  • Enum Classes
  • Methods
  • Constructors
  • Deprecated Interfaces
    Interface
    Description
    com.mongodb.connection.BufferProvider
    There is no replacement for this interface.
    com.mongodb.connection.Stream
    There is no replacement for this interface.
    com.mongodb.connection.StreamFactory
    There is no replacement for this interface.
    com.mongodb.connection.StreamFactoryFactory
    There is no replacement for this interface.
  • Deprecated Classes
    Class
    Description
    com.mongodb.connection.AsynchronousSocketChannelStreamFactory
    There is no replacement for this class.
    com.mongodb.connection.AsynchronousSocketChannelStreamFactoryFactory
    There is no replacement for this class.
    com.mongodb.connection.netty.NettyStreamFactory
    there is no replacement for this class
    com.mongodb.connection.netty.NettyStreamFactoryFactory
    Prefer NettyTransportSettings, creatable via TransportSettings.nettyBuilder() and applied via MongoClientSettings.Builder.transportSettings(TransportSettings)
    com.mongodb.connection.SocketStreamFactory
    There is no replacement for this class.
    com.mongodb.connection.TlsChannelStreamFactoryFactory
    There is no replacement for this class.
    com.mongodb.event.ClusterListenerAdapter
    com.mongodb.event.ConnectionAddedEvent
    Prefer ConnectionCreatedEvent
    com.mongodb.event.ConnectionPoolListenerAdapter
    com.mongodb.event.ConnectionPoolOpenedEvent
    Prefer ConnectionPoolCreatedEvent
    com.mongodb.event.ConnectionRemovedEvent
    Prefer ConnectionClosedEvent
    com.mongodb.event.ServerListenerAdapter
    com.mongodb.event.ServerMonitorListenerAdapter
  • Deprecated Enum Classes
    Enum Class
    Description
    com.mongodb.client.model.MapReduceAction
    Superseded by aggregate
  • Deprecated Methods
    Method
    Description
    com.mongodb.bulk.BulkWriteResult.acknowledged(int, int, int, Integer, List<BulkWriteUpsert>)
    Prefer BulkWriteResult.acknowledged(int, int, int, Integer, List, List) instead
    com.mongodb.bulk.BulkWriteResult.acknowledged(WriteRequest.Type, int, Integer, List<BulkWriteUpsert>)
    Prefer BulkWriteResult.acknowledged(int, int, int, Integer, List, List) instead
    com.mongodb.bulk.BulkWriteResult.acknowledged(WriteRequest.Type, int, List<BulkWriteUpsert>)
    Prefer BulkWriteResult.acknowledged(int, int, int, Integer, List, List) instead
    com.mongodb.bulk.WriteConcernError.addLabel(String)
    Prefer using error labels included in the top level response document
    com.mongodb.bulk.WriteConcernError.getErrorLabels()
    Prefer using error labels included in the top level response document
    com.mongodb.client.model.Indexes.geoHaystack(String, Bson)
    geoHaystack is deprecated in MongoDB 4.4, prefer Indexes.geo2dsphere(String...)
    com.mongodb.client.model.IndexOptions.bucketSize(Double)
    geoHaystack is deprecated in MongoDB 4.4
    com.mongodb.client.model.IndexOptions.getBucketSize()
    geoHaystack is deprecated in MongoDB 4.4
    com.mongodb.event.ConnectionPoolListener.connectionAdded(ConnectionAddedEvent)
    Prefer ConnectionPoolListener.connectionCreated(com.mongodb.event.ConnectionCreatedEvent) Implementations should NOT implement this method at all, instead relying on the default no-op implementation. If an application implements both this method and connectionCreated, the application risks double-counting events.
    com.mongodb.event.ConnectionPoolListener.connectionPoolOpened(ConnectionPoolOpenedEvent)
    Prefer ConnectionPoolListener.connectionPoolCreated(com.mongodb.event.ConnectionPoolCreatedEvent) Implementations should NOT implement this method at all, instead relying on the default no-op implementation. If an application implements both this method and connectionPoolCreated, the application risks double-counting events.
    com.mongodb.event.ConnectionPoolListener.connectionRemoved(ConnectionRemovedEvent)
    Prefer ConnectionPoolListener.connectionClosed(com.mongodb.event.ConnectionClosedEvent) Implementations should NOT implement this method at all, instead relying on the default no-op implementation. If an application implements both this method and connectionClosed, the application risks double-counting events.
    com.mongodb.MongoClientSettings.Builder.streamFactoryFactory(StreamFactoryFactory)
    Prefer MongoClientSettings.Builder.transportSettings(TransportSettings)
    com.mongodb.MongoClientSettings.getStreamFactoryFactory()
    Prefer MongoClientSettings.getTransportSettings()
    com.mongodb.ReadPreference.isSlaveOk()
    Prefer ReadPreference.isSecondaryOk()
    com.mongodb.ServerAddress.getSocketAddress()
    Prefer InetAddress.getByName(String)
    com.mongodb.ServerAddress.getSocketAddresses()
    Prefer InetAddress.getAllByName(String)
    com.mongodb.TaggableReadPreference.isSlaveOk()
    com.mongodb.UnixServerAddress.getSocketAddress()
    com.mongodb.UnixServerAddress.getUnixSocketAddress()
    Prefer UnixSocketAddress(String)
  • Deprecated Constructors
    Constructor
    Description
    com.mongodb.bulk.WriteConcernError(int, String, String, BsonDocument, Set<String>)
    Prefer using error labels included in the top level response document
    com.mongodb.client.model.changestream.ChangeStreamDocument(OperationType, BsonDocument, BsonDocument, BsonDocument, TDocument, BsonDocument, BsonTimestamp, UpdateDescription, BsonInt64, BsonDocument)
    com.mongodb.client.model.changestream.ChangeStreamDocument(String, BsonDocument, BsonDocument, BsonDocument, TDocument, BsonDocument, BsonTimestamp, UpdateDescription, BsonInt64, BsonDocument)
    com.mongodb.client.model.changestream.ChangeStreamDocument(String, BsonDocument, BsonDocument, BsonDocument, TDocument, TDocument, BsonDocument, BsonTimestamp, UpdateDescription, BsonInt64, BsonDocument, BsonDateTime, BsonDocument)
    com.mongodb.connection.TlsChannelStreamFactoryFactory(AsynchronousTlsChannelGroup)
    Prefer TlsChannelStreamFactoryFactory()
    com.mongodb.event.CommandEvent(RequestContext, int, ConnectionDescription, String)
    Prefer CommandEvent(RequestContext, long, int, ConnectionDescription, String, String)
    com.mongodb.event.CommandEvent(RequestContext, long, int, ConnectionDescription, String)
    Prefer CommandEvent(RequestContext, long, int, ConnectionDescription, String, String)
    com.mongodb.event.CommandFailedEvent(int, ConnectionDescription, String, long, Throwable)
    com.mongodb.event.CommandFailedEvent(RequestContext, int, ConnectionDescription, String, long, Throwable)
    Prefer CommandFailedEvent(RequestContext, long, int, ConnectionDescription, String, String, long, Throwable)
    com.mongodb.event.CommandFailedEvent(RequestContext, long, int, ConnectionDescription, String, long, Throwable)
    com.mongodb.event.CommandStartedEvent(int, ConnectionDescription, String, String, BsonDocument)
    Prefer CommandStartedEvent(RequestContext, long, int, ConnectionDescription, String, String, BsonDocument)
    com.mongodb.event.CommandStartedEvent(RequestContext, int, ConnectionDescription, String, String, BsonDocument)
    Prefer CommandStartedEvent(RequestContext, long, int, ConnectionDescription, String, String, BsonDocument)
    com.mongodb.event.CommandSucceededEvent(int, ConnectionDescription, String, BsonDocument, long)
    com.mongodb.event.CommandSucceededEvent(RequestContext, int, ConnectionDescription, String, BsonDocument, long)
    Prefer CommandSucceededEvent(RequestContext, long, int, ConnectionDescription, String, String, BsonDocument, long)
    com.mongodb.event.CommandSucceededEvent(RequestContext, long, int, ConnectionDescription, String, BsonDocument, long)
    Prefer CommandSucceededEvent(RequestContext, long, int, ConnectionDescription, String, String, BsonDocument, long)
    com.mongodb.event.ConnectionCheckedInEvent(ConnectionId)
    Prefer ConnectionCheckedInEvent(ConnectionId, long)
    com.mongodb.event.ConnectionCheckedOutEvent(ConnectionId)
    Prefer ConnectionCheckedOutEvent(ConnectionId, long). If this constructor is used, then ConnectionCheckedOutEvent.getOperationId() is -1.
    com.mongodb.event.ConnectionCheckedOutEvent(ConnectionId, long)
    Prefer ConnectionCheckedOutEvent(ConnectionId, long, long). If this constructor is used, then ConnectionCheckedOutEvent.getElapsedTime(TimeUnit) is 0.
    com.mongodb.event.ConnectionCheckOutFailedEvent(ServerId, long, ConnectionCheckOutFailedEvent.Reason)
    Prefer ConnectionCheckOutFailedEvent(ServerId, long, Reason, long). If this constructor is used, then ConnectionCheckOutFailedEvent.getElapsedTime(TimeUnit) is 0.
    com.mongodb.event.ConnectionCheckOutFailedEvent(ServerId, ConnectionCheckOutFailedEvent.Reason)
    Prefer ConnectionCheckOutFailedEvent(ServerId, long, Reason) If this constructor is used, then ConnectionCheckOutFailedEvent.getOperationId() is -1.
    com.mongodb.event.ConnectionCheckOutStartedEvent(ServerId)
    Prefer ConnectionCheckOutStartedEvent(ServerId, long)
    com.mongodb.event.ConnectionReadyEvent(ConnectionId)
    Prefer ConnectionReadyEvent(ConnectionId, long). If this constructor is used, then ConnectionReadyEvent.getElapsedTime(TimeUnit) is 0.
    com.mongodb.event.ServerHeartbeatFailedEvent(ConnectionId, long, Throwable)
    Prefer ServerHeartbeatFailedEvent(ConnectionId, long, boolean, Throwable)
    com.mongodb.event.ServerHeartbeatSucceededEvent(ConnectionId, BsonDocument, long)
    Prefer ServerHeartbeatSucceededEvent(ConnectionId, BsonDocument, long, boolean)
    com.mongodb.MongoBulkWriteException(BulkWriteResult, List<BulkWriteError>, WriteConcernError, ServerAddress)
    Prefer MongoBulkWriteException(BulkWriteResult, List, WriteConcernError, ServerAddress, Set) instead
    com.mongodb.MongoCursorNotFoundException(long, ServerAddress)
    Prefer MongoCursorNotFoundException(long, BsonDocument, ServerAddress)
    com.mongodb.MongoQueryException(MongoCommandException)
    Prefer MongoQueryException(BsonDocument, ServerAddress)
    com.mongodb.MongoQueryException(ServerAddress, int, String)
    Prefer MongoQueryException(BsonDocument, ServerAddress)
    com.mongodb.MongoQueryException(ServerAddress, int, String, String)
    Prefer MongoQueryException(BsonDocument, ServerAddress)