Created
February 16, 2012 14:11
-
-
Save baio/1845115 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var server = MongoServer.Create("mongodb://user:[email protected]:29787"); | |
server.Connect(); | |
var database = server.GetDatabase("sx_election2012"); | |
var collection = database.GetCollection<Doc>("moscow"); | |
//var t = collection.AsQueryable<Doc>().Where(p => p.boundary.Any(s => Regex.IsMatch(s, "", RegexOptions.IgnoreCase))); | |
var q = Query.Matches("district", BsonRegularExpression.Create(".*центр.*", "i")); | |
var t = collection.Find(q); | |
var zzz = t.ToArray(); | |
var f = t.First(); | |
var q1 = Query.Near("station.geo", f.geo.ElementAt(0), f.geo.ElementAt(1), 1); | |
var zzz1 = collection.Find(q1).ToArray(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment