InvalidOperation

Python (PyMongo)PyMongoErrorconfiguration

Raised when an invalid operation is attempted (e.g. using a closed client, modifying a cursor after execution)

Related Jira Issues

CSHARP-6223Closed
LINQ3 regression since v3.10: Project(MemberInit) with date string formatting throws VisitMemberInit/NewExpression InvalidOperationException
After upgrading MongoDB .NET/C# Driver from 3.9.0 to 3.10.0 (still reproducible on 3.11.1), a previously working LINQ projection now throws: *Environment* •    MongoDB.Driver: 3.11.1 (regression started in 3.10.0) •    .NET: 8.0 •    Query executed via LINQ3 provider (Find(...).Project(...).ToList())   *Repro shape* The exception is thrown in a Project with new DTO \{ ... } (MemberInit) when formatting a BsonDateTime to string inside projection:   The rest of the projectio
CSHARP-5480Backlog
Standardize exceptions in BsonAttributes
1. Change to InvalidOperationException to NotSupportedException applicable 2. Consider augmenting exceptions raised by attribute.Apply in AttributeConventionPack with Member name 3. Ensure that all attributes are consistent in throwing/ignoring the invalid configuration
CSHARP-5905Closed
"System.InvalidOperationException: ValueFactory attempted to access the Value property of this instance." when using EnumRepresentationConvention or ObjectSerializerAllowedTypesConvention
h4. Summary _When using either `EnumRepresentationConvention` or `ObjectSerializerAllowedTypesConvention`, if the type is recursive with a collection of the same type, initialization will fail with the following exception: "System.InvalidOperationException: ValueFactory attempted to access the Value property of this instance."_ h4. Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).
JAVA-6029Backlog
Value classes in sealed polymorphic structures fail to serialize
Here's example code:   If i try to save TokenEntity it will error with: {code:java} org.bson.BsonInvalidOperationException: writeString can only be called when State is VALUE, not when State is NAME at org.bson.AbstractBsonWriter.throwInvalidState(AbstractBsonWriter.java:748) at org.bson.AbstractBsonWriter.checkPreconditions(AbstractBsonWriter.java:703) at org.bson.AbstractBsonWriter.writeString(AbstractBsonWriter.java:608) at com.mongodb.internal.connection.BsonWriterDecorator.writeStri