Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-923

Using $eq on a geospatial indexed GeoJsonPoint<GeoJson2DCoordinates> field, uses a basic cursor instead of index

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.8.3
    • Component/s: None
    • None
    • Environment:
      Windows, nothing special besides that (replicated on Win7/Server 2012)
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I have a class which has an indexed GeoJsonPoint<GeoJson2DCoordinates>, using $near works perfectly well, but when I do the following:

      IMongoQuery query = Query<Player>.EQ(p => p.RandomGeoIdentifier, RandomID);
      return players.Find(query).SetLimit(1).Size() == 0;

      It does a full table scan without using the index.

      Adding a hint, causes the query to scan 1 object if exists.
      return players.Find(query).SetHint("Random Geo ID").SetLimit(1).Size() == 0;

      I believe this is a bug and Mongo should use this index by default.

            Assignee:
            Unassigned Unassigned
            Reporter:
            rejwan Ron Rejwan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: