Ghini / ghini.web

web and geo interface to ghini.desktop database
GNU Affero General Public License v3.0
4 stars 1 forks source link

update 'phonetic' field according to new shorten #34

Closed mfrasca closed 6 years ago

mfrasca commented 6 years ago

I've updated the 'shorten' function in cuchubo.js, so we have the same definition in both g.web and g.pocket. We should also update the 'phonetic' field in the database, or we won't be able to find our plants.

mfrasca commented 6 years ago

just run this:

conn = new Mongo();
db = conn.getDB("gardens");

var c = db.taxa.find();
while (c.hasNext()) {
  object = c.next(); 
  phonetic = shorten(object.name);
  db.taxa.update({_id: object._id}, {$set: {'phonetic': phonetic}});
}