You could get this situation when you are trying to deserialize a fragment as a document.
Dan
Are there any projects that create "QueryComplete"s using fluent syntax? I dabble with fluentmongo a little but don't think this offers this functionality. It would be handy though for when one needs a query as part of an update.
Dan
Is there a reason the QueryBuilder doesn't seem to take into account the IdMemberConvention? e.g. I have lots of Id fields that the driver maps to _id on serialisation, but I have to remember to use _id in Query.EQ("_id", xxx) etc...
Dan
I'm using them in URLs so would like to tighten up the matching a bit. Thinking I might also add a checksum when they are exposed externally...
Dan
The reason I was asking is that the URL routing mechanism can consider a regex (and possibly more if I extend it hence checksum thoughts), which gives me more flexibility if I can identify an object Id. e.g. if I can filter by this then these two urls can go to different targets:
www.mysite.com/Members/h3hi312i123uh213u123ew23
vs
Not such a great example, but gives an idea what I'm thinking...
Given that it's hex I guess I can consider re-encoding to use full char set etc and maybe inserting some hyphens etc if I want it to be more matchable for URLs.
Thanks for the help,
Dan
1 - renamed this thread as title unrelated to problem!
2 - are you modifying and of these docs after persisting them, or is it going wrong simply after a save, then direct reload? If you are making modifications using direct operators on objects, its very easy to break the object vs your schema.
3 - I had some strange deserialization probs when I once forgot to make some fields properties. It serialized fine, but choked on deserialize. I don't think it was that stack trace, but just a thought....
Robert's ideas are better though if you can build and run the driver. The code is fairly easy to follow in my experience (I've had to work out a fair few things from looking at it myself....)
Otherwise you will need to try and drill down to get a repeatable test case. If you can't do this through the data easily, one approach would be to start marking properties as bson ignored and use a binary search approach to doing this to narrow down what field is causing the probs. I'd prefer the driver debug approach though!
Do you then modify/update these objects in any way before you try to load them back into your app and get that serialisation error?
field vs property:
class Foo
{
public int aField;
public int aProperty { get; set; }
}
Mongo c# driver will get into trouble deserializing into properties.
Dan
You shouldn't need to send all the data etc now that you've worked out where the problem is.
Dan
> ...
>
> קרא עוד »
> ...
>
> קרא עוד »