You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems that there is a bug with using Guid in the map function when doing MapReduce.
If I try to do this.query.Where(c => c.RessourceIdentifier = myGuid).Average(c => c.Value) I get no result if RessourceIdentifier is a Guid.
It works if RessourceIdentifier is a numeric.
Maybe it's because a Guid is stored as binary data in mongodb and in the map function you try to match the Guid as a string.
public class TestGuidIssue
{
public Guid RessourceIdentifier { get; set; }
public int Value { get; set; }
}
The text was updated successfully, but these errors were encountered:
You are correct. If it has to do a map/reduce function (eg.avg, max, min, sum) then it uses javascript, which can't compare a guid because it is binary. This is the same issue if you are doing a (or, ||) comparison in which a guid is also involved.
How about comparing the BinData- fields ".base64()" (and optionally ".subtype()") in the query? These fields should be available from inside the javascript expressions; something like:
I've taken a short look at the NoRM code, but not compiled it or applied any changes myself cause I'm missing both compiler and coding tools other then notepad (^^) at the moment; but I might be able to look into this soon. Why is the Code for Guid's doing "string.Format(""{0}"", value);" anyway? Especially with the if-branch "value is ObjectId || value is Guid". Are there cases which work that way that I miss?
Hi,
Seems that there is a bug with using Guid in the map function when doing MapReduce.
If I try to do this.query.Where(c => c.RessourceIdentifier = myGuid).Average(c => c.Value) I get no result if RessourceIdentifier is a Guid.
It works if RessourceIdentifier is a numeric.
Maybe it's because a Guid is stored as binary data in mongodb and in the map function you try to match the Guid as a string.
public class TestGuidIssue
{
public Guid RessourceIdentifier { get; set; }
public int Value { get; set; }
}
The text was updated successfully, but these errors were encountered: