-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.3
-
Component/s: Linq
I am having an issue when creating a FilterDefinition with a nullable decimal. The decimal scaling factor is not being honored.
– Example –
class Foo
{
public decimal? Amount
}
In MongoChef the Document looks like this
{ "_id" : ObjectId("5994596fcb337f716c4c827c"), "invoiceTotal" : "0.00" }I want to get all documents where Amount != null and Amount != 0.00
IMongoCollection<Foo> _collection;
_collection.FindAsync(x => x.Amount != null && x.Amount != 0.00m)
Creates a FilterDefinition: "{ "amount" :
, "amount" :
{ "$ne" : "0" }}"
Document ObjectId("5994596fcb337f716c4c827c") is returned in the result set. But its Amount is 0.00
You can see the issue in the FilterDefinition the decimal scaling factor was not honored when the FilterDefinition was created.