GridFS and Geospatial

GridFS - specification for storing and retrieving large files... images,audio file, video files...

File system to store the chunks. Data is stored within MongoDB collections... 

 

Geospatial:

#2d sphere 
{type: 'point', coordinates: [40 ,5 ]}
#2d sphere index creation 

db[:zips].indexes.create_one({:loc=>Mongo::Index::GEO2DSPHERE})

#2d sphere queries 
db[:zips].find(:loc=> 
                   {:$near => { 
                     :$geometry=>{:type=>"Point", :coordinates=>[-76.625203, 39.29463]},
                      :$minDistance => 10000,
                      :$maxDistance => 50000

            }
        }).each { |r| pp r}                             

 

posted @ 2019-04-25 11:11  vixennn  Views(104)  Comments(0)    收藏  举报