I have a collection with an integer field in it, max value in the collection is 64. I've been casting to Int32, but just got an error using the AsInt32, so I switched to AsInt64. Alas, there are documents that now throw
Unable to cast object of type 'MongoDB.Bson.BsonInt32' to type 'MongoDB.Bson.BsonInt64'.
Shouldn't that cast work? What type of cast can I use that will work with both int32 and int64 values?
Thanks,
John