Geospatial queries not returning correct results count

4 views
Skip to first unread message

nelsona

unread,
Sep 13, 2011, 5:45:49 AM9/13/11
to NoRM mongodb
Hi,

I am running into some problems with the geospatial querying
capabilities of NoRM.

When I run a query like this in the shell:
db.Webcard.find({"LatLong": {"$within":{"$box": box}}})
I get a results count of 17500

If I run this type of command in NoRM:
var template = new { LatLong = Q.WithinBox(southWest, northEast) };

var allEdinburgh = mongoSession.Find<T>(template).ToList();

I get a count of 2700

Are there any know problems with the geospatial querying within NoRM,
also is it possible to see what query NoRM is running against Mongo?

Cheers,

Alistair

nelsona

unread,
Sep 13, 2011, 6:42:32 AM9/13/11
to NoRM mongodb
Have turned on the profiling and when I run the first command I see
the following in the log:
query xxx.Webcard reslen:4195445 nscanned:2714
query: { LatLong: { $within: { $box: [ [ 55.71353777654521,
-3.651450659179659 ], [ 56.09843473312219,
-2.827476049804659 ] ] } } } nreturned:2714 bytes:4195429

When runningthe command in NoRM I see the following in the log:
query xxx.Webcard ntoreturn:2147483647 reslen:4195829 nscanned:2620
query: { query: { LatLong: { $within: { $box: [ [ 55.74717563145126,
-3.744147802734346 ], [ 55.93993524407045,
-3.332160498046846 ] ] } } } } nreturned:2620 bytes:4195813

From this is it likely that the NoRM command is not the correct
command?

Cheers,

Alistair

nelsona

unread,
Sep 13, 2011, 10:25:23 AM9/13/11
to NoRM mongodb
Ignore this, my misunderstandings are the issue here :-)

Got this working using an expando object to do the query I needed to
do.
Reply all
Reply to author
Forward
0 new messages