craiggwilson / fluent-mongo

Provides a fluent interface on top of the 10gen driver including Linq.
172 stars 28 forks source link

Problem with AsString cast in BsonDocumentCollection #54

Open object opened 12 years ago

object commented 12 years ago

The following query works fine:

        var people = (from p in Collection.AsQueryable()
                      where p.FirstName.Contains("oe")
                      select p).ToList();

But this one always returns an empty result set:

        var people = (from p in BsonDocumentCollection.AsQueryable()
                      where p["fn"].AsString.Contains("oe")
                      select p).ToList();

It appears that if I cast a BsonValue using AsString, no results will be fetched.

It would be nice to have support for this, otherwise query on BsonDocumentCollection is quite limited.