How can I query this JSON tree in MongoDB?
-
{ "_id" : "4f316a0e29d7f51720b03251", "totalTime" : 1717000, "totalDistance" : 13246.551, "segments" : [ { "totalTime" : 1717000, "totalDistance" : 13246.551, "wayPoints" : [ { "type" : "", "time" : 1326171013000, "latitude" : 17.41122, "longitude" : 89.48969 } ] } ] } 1.I'm using the above JSON doc to store a gps track. 2.I'm using MongoDB to store all the tracks. 3.A single track will have multilple segments. 4.Each segment will have hundreads of GPS waypoints. 5.Then I want to go for a specific segment of a track and get waypoints between a time range. 6. Finally, I would like to know your opinion on using MongoDB/NoSql for saving JSON tracks like above, assuming the in future there will be huge number of tracks to be saved in to DB. Thanks
-
Answer:
You might consider using GeoJSON to define your waypoints. You can use a LineString GeoJSON encoding to define your track & waypoints. http://docs.mongodb.org/manual/core/2dsphere/ Note that GeoJSON support is new in 2.4, and earlier versions only support point types.
Jared Rosoff at Quora Visit the source
Related Q & A:
- How can I optimize this dynamic SQL query in oracle with PL/SQL?Best solution by docs.oracle.com
- How can I query Parse data by creation date with Swift?Best solution by Stack Overflow
- How can I deserialize JSON {name, value} in C#?Best solution by Stack Overflow
- How can I clear the mongoDB oplog?Best solution by stackoverflow.com
- How can I grow a mango tree?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.