org.bson.BsonInvalidOperationException: readStartArray can only be called when CurrentBSONType is ARRAY, not when CurrentBSONType is DOCUMENT.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by redraushan
, 1 year ago
readStartArray can only be called when CurrentBSONType is ARRAY, not when CurrentBSONType is DOCUMENT.
via slideshare.net by Unknown author, 1 year ago
readString can only be called when CurrentBSONType is STRING, not when CurrentBSONType is ARRAY.
via sssslide.com by Unknown author, 1 year ago
readString can only be called when CurrentBSONType is STRING, not when CurrentBSONType is ARRAY.
via Stack Overflow by N.S.Karthik
, 1 year ago
readStartDocument can only be called when CurrentBSONType is DOCUMENT, not when CurrentBSONType is STRING.
via Stack Overflow by user2325154
, 1 year ago
readStartDocument can only be called when CurrentBSONType is DOCUMENT, not when CurrentBSONType is ARRAY.
via Stack Overflow by nairod
, 2 years ago
readBinaryData can only be called when CurrentBSONType is BINARY, not when CurrentBSONType is DOCUMENT.
org.bson.BsonInvalidOperationException: readStartArray can only be called when CurrentBSONType is ARRAY, not when CurrentBSONType is DOCUMENT.
at org.bson.AbstractBsonReader.verifyBSONType(AbstractBsonReader.java:655)
at org.bson.AbstractBsonReader.checkPreconditions(AbstractBsonReader.java:687)
at org.bson.AbstractBsonReader.readStartArray(AbstractBsonReader.java:414)
at com.mongodb.operation.CommandResultArrayCodec.decode(CommandResultArrayCodec.java:48)
at com.mongodb.operation.CommandResultDocumentCodec.readValue(CommandResultDocumentCodec.java:53)
at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:81)
at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:40)
at org.bson.codecs.configuration.LazyCodec.decode(LazyCodec.java:47)
at org.bson.codecs.BsonDocumentCodec.readValue(BsonDocumentCodec.java:98)
at com.mongodb.operation.CommandResultDocumentCodec.readValue(CommandResultDocumentCodec.java:56)
at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:81)
at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:40)

Users with the same issue

39 times, 9 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.