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

GitHub | redraushan | 8 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Error with mongodb gorm plugin!

    GitHub | 8 months ago | redraushan
    org.bson.BsonInvalidOperationException: readStartArray can only be called when CurrentBSONType is ARRAY, not when CurrentBSONType is DOCUMENT.

    Root Cause Analysis

    1. org.bson.BsonInvalidOperationException

      readStartArray can only be called when CurrentBSONType is ARRAY, not when CurrentBSONType is DOCUMENT.

      at org.bson.AbstractBsonReader.verifyBSONType()
    2. MongoDB Java Driver
      CommandProtocol.execute
      1. org.bson.AbstractBsonReader.verifyBSONType(AbstractBsonReader.java:655)
      2. org.bson.AbstractBsonReader.checkPreconditions(AbstractBsonReader.java:687)
      3. org.bson.AbstractBsonReader.readStartArray(AbstractBsonReader.java:414)
      4. com.mongodb.operation.CommandResultArrayCodec.decode(CommandResultArrayCodec.java:48)
      5. com.mongodb.operation.CommandResultDocumentCodec.readValue(CommandResultDocumentCodec.java:53)
      6. org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:81)
      7. org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:40)
      8. org.bson.codecs.configuration.LazyCodec.decode(LazyCodec.java:47)
      9. org.bson.codecs.BsonDocumentCodec.readValue(BsonDocumentCodec.java:98)
      10. com.mongodb.operation.CommandResultDocumentCodec.readValue(CommandResultDocumentCodec.java:56)
      11. org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:81)
      12. org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:40)
      13. com.mongodb.connection.CommandProtocol.execute(CommandProtocol.java:123)
      13 frames