NoRM and Geospatial with Nested Collection
Hello I use NoRM for managing Mongo, but I am wondering if it is possible to apply and use 2d indexing with it. I have followed the recommendations on this page http://groups.google.com/group/norm-mongodb/browse_thread/thread/f6623652ffc96386?fwc=1 However I want to know how to use it with a nested collection that contains an array of coordinates, so the code looks like this:
public class MainCollection : ModelBase
{
public string Type { get; set; }
public List<Criteria> CriteriaList { get; set; }
}
public class Criteria
{
public double[] Coordinates { get; set; }
}
I am using a NoRM Repository pattern, so I can do a query like:
var query = _mainCollectionRepository.Find(p => p.Type == "MyType");
If I had the coordinates array inside the MainCollection, I c开发者_StackOverflowould easily geo query MainCollection, but how can I query using the nested List of Criterias?
Thanks in advance for all the help.
Mauricio S.
精彩评论