Hey how’s it going. Been experimenting with the rust driver lately and have been running into this problem when I try to do a find_one_and_update() call where I get thrown a BsonDeserialization(EndOfStream) error result. The query and update seem to go through and makes the changes that I intend, but I returned an Err type
I am just curious if there is much documentation on EndOfStream error. Haven’t really found much on it, but I am assuming it has something to do with one of the docs that I am passing to the function that’s causing problems.
If this is a more complicated issue, let me know and I can give more details on filter/query/schema (I just need permission from my boss if I can post certain things).
Fixed my problem. Dumb mistake, basically what was happening was coming from here:
let devices_collection = self.db.database("deviceManagement").collection::<models::device_schema::Device>("devices");
Basically, to test some queries, I set up a slimmed down version of my schema but told bson, deserialize the output from the update call as the fully fleshed out schema. Obviously was getting EndOfStream error since…the deserializer was done deserializing but had missing values!
So imagine I had something like the following as my schema