ERROR - org.bson.BsonInvalidOperationException - Possible Causes of BsonInvalidOperationException

Exception Thrown By:Cause
ClassMethod
BsonDocument public BsonDocument getDocument(Object key) if the document does not contain the key or the value is
not a BsonDocument.
BsonDocument public BsonArray getArray(Object key) if the document does not contain the key or the value is
not of the expected type.
BsonDocument public BsonNumber getNumber(Object key) if the document does not contain the key or the value is
not of the expected type.
BsonDocument public BsonInt32 getInt32(Object key) if the document does not contain the key or the value is
not of the expected type.
BsonDocument public BsonInt64 getInt64(Object key) if the document does not contain the key or the value is
not of the expected type.
BsonDocument public BsonDouble getDouble(Object key) if the document does not contain the key or the value is
not of the expected type.
BsonDocument public BsonBoolean getBoolean(Object key) if the document does not contain the key or the value is
not of the expected type.
BsonDocument public BsonString getString(Object key) if the document does not contain the key or the value is
not of the expected type.
BsonDocument public BsonDateTime getDateTime(Object key) if the document does not contain the key or the value is
not of the expected type.
BsonDocument public BsonTimestamp getTimestamp(Object key) if the document does not contain the key or the value is
not of the expected type.
BsonDocument public BsonObjectId getObjectId(Object key) if the document does not contain the key or the value is
not of the expected type.
BsonDocument public BsonRegularExpression getRegularExpression(Object key) if the document does not contain the key or the value is
not of the expected type.
BsonDocument public BsonBinary getBinary(Object key) if the document does not contain the key or the value is
not of the expected type.
BsonDocument BsonDocument defaultValue) if the document contains the key but
the value is not of the expected type.
BsonDocument BsonArray defaultValue) if the document contains the key but
the value is not of the expected type.
BsonDocument BsonNumber defaultValue) if the document contains the key but
the value is not of the expected type.
BsonDocument BsonInt32 defaultValue) if the document contains the key but
the value is not of the expected type.
BsonDocument BsonInt64 defaultValue) if the document contains the key but
the value is not of the expected type.
BsonDocument BsonDouble defaultValue) if the document contains the key but
the value is not of the expected type.
BsonDocument BsonBoolean defaultValue) if the document contains the key but
the value is not of the expected type.
BsonDocument BsonString defaultValue) if the document contains the key but
the value is not of the expected type.
BsonDocument BsonDateTime defaultValue) if the document contains the key but
the value is not of the expected type.
BsonDocument BsonTimestamp defaultValue) if the document contains the key but
the value is not of the expected type.
BsonDocument BsonObjectId defaultValue) if the document contains the key but
the value is not of the expected type.
BsonDocument BsonBinary defaultValue) if the document contains the key but
the value is not of the expected type.
BsonDocument BsonRegularExpression defaultValue) if the document contains the key but
the value is not of the expected type.