mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-30 07:47:19 +00:00
documented a Mongo operation involving a looping update
This commit is contained in:
1 parent
7b42cc5f8e
commit
75b8c7da64
1 file changed
+4
@@ -33,3 +33,7 @@ Update the wind track data
|
||||
|
||||
mongo update command:
|
||||
db.WIND_TRACKS.update({REGATTA_NAME: "Sailing Team Germany"}, { $set: {REGATTA_NAME: "Academy Tracking 2011"}}, true, true)
|
||||
|
||||
or something along the lines of:
|
||||
|
||||
db.eval(function() { db.RACE_LOGS.find({"RACE_LOG_IDENTIFIER.a": /ESS 2013 Porto*/, "RACE_LOG_EVENT.RACE_LOG_EVENT_CLASS" : "RaceLogWindFixEvent"}).forEach(function(e) { if (e.RACE_LOG_EVENT.WIND.DEGREE_BEARING < 0) { e.RACE_LOG_EVENT.WIND.DEGREE_BEARING = e.RACE_LOG_EVENT.WIND.DEGREE_BEARING+360.; db.RACE_LOGS.save(e); }}); })
|
||||
Reference in new issue
Block a user