@ SuppressWarnings ( "deprecation" ) public int getMaxBsonObjectSize ( ) { List < ServerDescription > primaries = getClusterDescription ( ) . getPrimaries ( ) ; return primaries . isEmpty ( ) ? ServerDescription . getDefaultMaxDocumentSize ( ) : primaries . get ( 0 ) . getMaxDocumentSize ( ) ; }
Gets the maximum size for a BSON object supported by the current master server . Note that this value may change over time depending on which server is master .