I am using a code snippet to update multiple records once per day.
This is how I have customized it:
var today = new Date ();
var result = Collection.multiUpdateObject(dbId, collectionName, '{'vaccines': {"$gte": today}} ', {"vac_test": false});
I have a day stored in the vaccines column of the Appery.io database as a string. This is its format: Tue Aug 23 2016 00:00:00 GMT-0500 (CDT)
I basically want to update the vac_test boolean if today's date is after the date in the database.
I am not sure that I fully understand how this works.
Do I have to replace dbId and collectionName or is that automatically found?
I get an error when I test this:
Script auto_shot_update: SyntaxError: missing ) after argument list ( @ 31 : 64 ) - var result = Collection.multiUpdateObject(dbId, collectionName, '{'vaccines': {"$gte": today}} ', {"vac_test": false});I have shared this with support and it is called "auto_shot_update" if you need to look at it.
This is not user specific, but it will query the entire "Calf_data" collection.